java正则表达式替换空格和换行符
2024-08-24 20:01:23
- public class StringUtil {
- public static String getStringNoBlank(String str) {
- if(str!=null && !"".equals(str)) {
- Pattern p = Pattern.compile("\\s*|\t|\r|\n");
- Matcher m = p.matcher(str);
- String strNoBlank = m.replaceAll("");
- return strNoBlank;
- }else {
- return str;
- }
- }
}
最新文章
- Web性能优化:What? Why? How?
- 缩略信息是: sending message to a Handler on a dead thread 我是用IntentService时报的
- mac上用teamviewer远程windows输入问题
- HttpWebRequest header configuration
- Ionic 开发环境搭建
- Spark函数
- 如何用 ANTLR 4 实现自己的脚本语言?
- 基于vue2.0前端组件库element中 el-form表单 自定义验证填坑
- 005---query接口初步
- Python爬虫之urllib模块1
- Lesson 25 Do the English speak English?
- linux systemctl 命令学习
- asp.net-基础-20180320
- 81For全栈技术网
- 【repost】前端学习总结(二十三)——前端框架天下三分:Angular React 和 Vue的比较
- Python 入门基础20 --面向对象_继承、组合
- mysql字符集问题,及排序规则
- linux系统安装pycharm环境
- 百度图表库ECharts
- C语言—单链表
热门文章
- jwt再度理解
- Java锁的选择
- Linux 高级文本处理命令
- SDI初识
- Delphi:窗体的扩展样式GWL_EXSTYLE用于SetWindowLong
- Azure ARM (15) 根据现有VHD文件,创建ARM VM
- 黄聪:pjax使用心得总结
- 测试教程网.unittest教程.2. 基本用法
- PREV-9_蓝桥杯_大臣的旅费
- Office 2016 Pro Plus \ Project 专业版 \ Visio 专业版 \ 64 位vol版本方便KMS小马oem