TrinityTuts Tips

Remove non numeric characters from string Java

This piece of code help you to remove non numeric character from string variable in java

String str = "(123) 123-1234";
str = str.replaceAll("[^\\d]", "");

🙂