1 2 3 4 5 6 7 8 9 10 11
package web; public class RemoveCharacters { public static void main(String[] args) { String s = "(123)-456-7891-!@#$%^&*"; s = s.replaceAll("[^a-zA-Z0-9]", ""); System.out.println(s); } }
No comments:
Post a Comment