A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

String tmp = "xxxx123"
String description = Pattern.compile("[\\d]").matcher(tmp).replaceAll("");
// description = xxxx
1
2
3
解析:\d表示数字字符,将目标字符串中的数字字符全部替换成空串并返回新串。
---------------------
转载,仅作分享,侵删
作者:咸煌
原文:https://blog.csdn.net/qq_21084687/article/details/83586659


1 个回复

倒序浏览
奈斯
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马