0

For instance, I have the String variable abbaabbbba. I would like to use String split so each character would be separated, so it would be {a,b,b,a,a,b,b,b,b,a}. All the instructions I can find for string split say i need to have something, like a a space:

String mySplit = str.split("/");

Is there anyway to do this by character?

1 Answers1

0

You can use the toCharArray method like this:

String myString = "abbaabbbba";
char[] myCharacters = myString.toCharArray();
Mirna De Jesus
  • 199
  • 1
  • 4