java.lang.StringIndexOutOfBoundsException: String index out of range:

One Star

java.lang.StringIndexOutOfBoundsException: String index out of range:

Hi,
I am getting java.lang.StringIndexOutOfBoundsException: String index out of range: -2 while loading the talend job;
Exception in component tMap_1
java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(String.java:1937)
at routines.StringHandling.LEFT(StringHandling.java:210)
In my tmap_1
StringHandling.RIGHT(StringHandling.LEFT(context.filepath,StringHandling.INDEX(context.filepath,"XLS")-1),2)
Please help me
Chin
One Star

Re: java.lang.StringIndexOutOfBoundsException: String index out of range:

Your index is out of range probably because it didn't find an occurrence of XLS and you tried to do a left and right function on it.