I\'m writing following program to separate characters from a string and assign it to an array.
public class Str {
public static void main(String[] args)
Have you tried the toCharArray() method from the String class.
The issue with splitting the String with this "" is that "" matches the first character in the string and therefore you get an empty character.
To verify this claim. You could try str.indexOf(""). This would give you a value 0. If the argument does not occur as a substring, -1 is returned, according to the documentation.