import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author lei * 2011-9-2 */ public class StringUtils { public static String replaceBlank(String str) { String dest = ""; if (str!=null) { Pattern p = Pattern.compile("\\s*|
我整理了几个比较适合的实例了,对于它们我们是有很多站长都测试过并用过了,不过文章最后我的总结也是生重要的哦,至于原因我也说不上了,因为chr是ascii编码了所以有时浏览器会自动转成ascii,特别像ff浏览器就是这样的. 一,下例可以去除额外空白 代码如下 复制代码 <?php $str = " This line containstliberal rn use of whitespace.nn"; // First remove the leading/trailing
1.回车换行符 chr(10)是换行符,chr(13)是回车, 增加换行符 select ' update ' || table_name || ' set VALID_STATE =''0A'';'||chr(13)||' commit;' from user_tables 删除换行符 select id,replace(content,to_char(chr(13))||to_char(chr(10)),'_r_n') from fact_content order by co