Back
Below is the String I want to split into single characters:
"abcd".split("");
This is the output I get: ["", "a", "b", "c", "d"]
I get this empty delimiter at the limiter. Can anyone tell me what’s the reason behind it?
The better way to go about this would be, use String.toCharArray() which will give an array of characters.
Interested in Java? Check out this Java tutorial by Intellipaat.
31k questions
32.8k answers
501 comments
693 users