会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
junxin_zxf
博客园
首页
新随笔
联系
管理
订阅
2019年6月28日
Java 字符串去掉空格的几种方式
摘要: String str = " Hello Genius! "; //方法1:String.trim();trim()是去掉首尾空格 System.out.println("1:"+str.trim()); //方法2:str.replaceAll(" ", ""); 去掉所有空格,包括首尾、中间 S
阅读全文
posted @ 2019-06-28 11:52 junxin_zxf
阅读(3553)
评论(0)
推荐(0)
公告