I see. So the thing is that
split does not help you with that. As the name already suggests, it splits a String on a specific character that you provide. E.g.
"foo:bar".split(":") returns an array with the values
What you want is to concatenate the characters that you found into a new string. Concatenating is just another word for attaching something, in your case to a string.
I’ll give you a hint how you can do that:
(1) Create an empty string e.g.
my_result = ""
(2) Concatenate the characters that you found inside the for loop to that String variable. You can use the
+ operator like so
my_result = my_result + "a", or the short version
my_result += "a"
I hope this helps you.