I'm new to Java. How I can get only the numbers from this String:
我是Java的新手。我怎么才能得到这个字符串中的数字:
folder333
Can you show me some basic example?
你能告诉我一些基本的例子吗?
Also I would like to do this with Java 8.
我也想用Java 8做到这一点。
1 个解决方案
#1
4
Try something like:
尝试以下方法:
String number = str.replaceAll("^[a-zA-Z]*", "");
#1
4
Try something like:
尝试以下方法:
String number = str.replaceAll("^[a-zA-Z]*", "");