I have this simple Java code which gives the following error: java.lang.StringIndexOutOfBoundsException: String index out of range: -4
the code is:
String date = "14000101";
String repayDate = date.substring(0, 4)+"-"+date.substring(5, 2)+"-"+date.substring(6, 2);
the length of the string is 8 and yet it gives an error starting form the second part.
Any ideas?
Thanks!