If I split "hello|" and "|hello" with "|" character, then I get one value for the first and two values for the second version.
String[] arr1 = new String("hello|").split("\\|");
String[] arr2 = new String("|hello").split("\\|");
System.out.println("arr1 length: " + arr1.length + "\narr2 length: " + arr2.length);
This prints out:
arr1 length: 1
arr2 length: 2
Why is this?