英文:
How to take out the numbers from the String and eliminate those number and store the filtered String and print it in java
问题
String txt = "d89%l++5r19o7W *o=1645le9H";
System.out.println(t.replace(/\\d{0,}/g,''));
英文:
String txt = "d89%l++5r19o7W *o=1645le9H"
System.out.println(t.replace(/\\d{0,}/g,''));
答案1
得分: 1
因为我很无聊...
String txt = "d89%l++5r19o7W *o=1645le9H";
txt = txt.replaceAll("\\d", "");
System.out.println(txt);
英文:
Because i'm bored...
String txt = "d89%l++5r19o7W *o=1645le9H";
txt = txt.replaceAll("\\d", "")
System.out.println(txt);
答案2
得分: 0
这将从字符串中删除所有数字字符
System.out.println(string.replaceAll("\\d", ""));
英文:
This will all numerical charactors from string
System.out.println(string.replaceAll("\\d",""));
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论