0

How would you split an existing string where a chararacter occurs into an array of strings, and store that character in a char? For example, inputting 123a5 would return {123,5} in an array and 'a' in a char. I've confused myself with this. I will greatly appreciate any help.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Rockyboy53
0

String a = "abcd125xyz1mniop897";

String[] n = a.split("[a-zA-Z]+");

Now you have to form similar way regex for getting character array... String[] c...

0

This is a different quest

Step 1. read the string (for eg : myString)

Step2: get each character in the string by the method
myStinr.charAt();
upto to the length of the string.
Step 3: then check each character with its ASCII value

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.