我要把html的<br>转成换行字符'\n',这样就可在edit控件上显示原来在
网页上的段落格式主要涉及换行和空格;
  难道你不知道网页上的换行空格和edit上显示是不一样的?
谁有代码,帮一下

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/1885/1885870.xml?temp=.2868006
      

  2.   

    public static String ReplaceTagChar(String strin){        if (strin == null )
            {
                return strin;
            }
            if (strin.equals("") )
            {
                return strin;
            }
            strin = Replace(strin, "&"    ,"&amp;");
            strin = Replace(strin, "<"    ,"&lt;");
            strin = Replace(strin, ">"    ,"&gt;");
            strin = Replace(strin, "\""   ,"&quot;");
            strin = Replace(strin, "\r\n" ,"<br>");
            strin = Replace(strin, "\n" ,"<br>");        return strin;
        }
      

  3.   

    str.replaceALL( "<br/>", "\\n" );
    str.replaceALL( "&nbsp;", " " );
      

  4.   

    to xkp:replaceALL在java里找不到,请问出自哪个类库