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.
Rockyboy53
0
Newbie Poster
Recommended Answers
Jump to PostString a = "abcd125xyz1mniop897";
String[] n = a.split("[a-zA-Z]+");
Now you have to form similar way regex for getting character array... String[] c...
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.