Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

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? 

1 Answer

0 votes
by (19.7k points)

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.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Oct 3, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer

Browse Categories

...