I do not understand the output of this code:
public class StringDemo{
public static void main(String args[]) {
String blank = \"\";
From String class javadoc for the public String[] split(String regex) method:
Splits this string around matches of the given regular expression.
This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings are therefore not included in the resulting array.
In the first case, the expression does not match any part of the input so we got an array with only one element - the input.
In the second case, the expression matches input and split should return two empty strings; but, according to javadoc, they are discarded (because they are trailing and empty).