Ejemplo n.º 1
0
 /**
  * [大笑] => <img alt="大笑" src="/px-rest/w/xheditor/xheditor_emot/default/laugh.gif""/>
  * 将myubb字符串img转成格式.
  *
  * @param img
  * @return
  */
 public static String myubb_to_img(String myubb) {
   if (StringUtils.isEmpty(myubb)) {
     return "";
   }
   String tmp_myubb = myubb;
   tmp_myubb = PxStringUtil.StringDecComma(tmp_myubb, MyUbbUtils.MyUbb_Prefix);
   tmp_myubb = PxStringUtil.StringDecComma(tmp_myubb, MyUbbUtils.MyUbb_Suffix);
   for (String s : map.keySet()) {
     if (tmp_myubb.equals(s)) {
       String img =
           "<img style=\"display: inline;\" alt=\"" + s + "\" src=\"" + map.get(s) + "\" />";
       return img;
     }
   }
   // 没匹配,则直接返回
   return myubb;
 }