Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I have a tMap and use a substring formula on 1 of the lookup column. The formula is like this
row4.Merchandising_Code.substring(1,3)
When I run, I got an error says StringIndexOutOfBoundException: String Index Out Of Range: 3. When I look into my column values, there's some of the value that has 3 characters and there's also a blank value. After searching in this forum, I changed my query into this one
row4.Merchandising_Code.substring(1,Math.min(3, row4.Merchandising_Code.length()))
But I still got an error and now its String Index Out Of Range: -1. I think it because of the blank value. What should I change in the formula to catch blank values?
@Hilman Utomo , can you try to use the below on.so you will not get IndexOutOfBoundsException.
row4.Merchandising_Code.length()>3?row4.Merchandising_Code.substring(1,3) :row4.Merchandising_Code
Thanks,
Manohar
@Hilman Utomo , can you try to use the below on.so you will not get IndexOutOfBoundsException.
row4.Merchandising_Code.length()>3?row4.Merchandising_Code.substring(1,3) :row4.Merchandising_Code
Thanks,
Manohar
Thanks a lot, Sir