如何从java中的字符串中删除非数字字符?
问题描述:
我有一个很长的字符串。将数字拆分成数组的正则表达式是什么?
I have a long string. What is the regular expression to split the numbers into the array?
答
您要删除还是拆分?这将删除所有非数字字符。
Are you removing or splitting? This will remove all the non-numeric characters.
myStr = myStr.replaceAll( "[^\\d]", "" )