I was just doodling on eclipse IDE
and written following code.
String str = new String("A$B$C$D");
String arrStr[] = str.split("$");
for (int i = 0; i < arrStr.length; i++) {
System.out.println("Val: "+arrStr[i]);
}
I was expecting output like:
Val: A
Val: B
Val: C
Val: D
But instead of this, I got output as
Val: A$B$C$D
Why? I am thinking may be its internally treated as a special input or may be its like variable declaration rules.