怎么查找替换字符串中的特殊字符

2024-11-07 09:30:58
推荐回答(1个)
回答(1):

content = content.replaceAll("]+>", ""); //替换HTML标签
content = content.replaceAll(" ", ""); //替换空格
content = content.replaceAll("<", "<"); //替换小于号
content = content.replaceAll(">", ">"); //替换大于号
content = content.replaceAll("\\s*|\t|\r|\n",""); //去除字符串中的空格,回车,换行符,制表符