Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void words(String n) {
- int num = 0;
- String x[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
- for (int i = 0; i < n.length(); i++) {
- for (int j = 0; j < x.length; j++)
- if (String.valueOf(n.charAt(i)).equals(x[j])) {
- String words = n.substring(num , i);
- System.out.print(words);
- num = i+1;
- }
- // string n = "BASSAM222WWW12341KMKMKM999"
- // Result = BASSAMWWWKMKMKM
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement