在后台添加一篇文章,在前台显示的格式与后台添加的这篇文章格式一模一样
有没有谁做过
在后台添加一篇文章,在前台显示的格式与后台添加的这篇文章格式一模一样
该怎么实现,,谢了,
------解决方案--------------------/**
* Function Detail : 对输入的字符处理
* @param pstrWord
* @return
* @throws
java.io.UnsupportedEncodingException */
public static String replaceIn(String pstrWord) throws Exception
{
//pstrWord = replace(pstrWord);
pstrWord = htmlEncode(pstrWord);
pstrWord = pstrWord.replaceAll( "\n ", " <br> ");
pstrWord = pstrWord.replaceAll( " ", "  ");
pstrWord = pstrWord.replaceAll( " ", " ");
return pstrWord;
}
/**
* Function Detail : 对输出的字符处理
* @param pstrWord
* @return
* @throws java.io.Unsupported
EncodingException */
public static String replaceOut(String pstrWord) throws Exception
{
pstrWord = pstrWord.replaceAll( " <br> ", "\n ");
pstrWord = pstrWord.replaceAll( "  ", " ");
pstrWord = pstrWord.replaceAll( " ", " ");
pstrWord = toChinese(pstrWord);
return pstrWord;
}
这些可以完成的(转自另一高手名字忘了)