Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if((input_row.Country) != null && ((String)input_row.Country).contains("("))
output_row.Country = StringHandling.LEFT(input_row.Country,StringHandling.INDEX(input_row.Country,"("));
else if((input_row.Country) != null && !((String)input_row.Country).contains("("))
output_row.Country = input_row.Country;
StringHandling.LEFT(row1.newColumn,StringHandling.INDEX(row1.newColumn,"("))
Hi,
you could try :StringHandling.LEFT(row1.newColumn,StringHandling.INDEX(row1.newColumn,"("))
Hi, This is still showing me the following error:-
Exception in component tJavaRow_1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at routines.StringHandling.LEFT(StringHandling.java:218)
at roamware.copy_of_rw_add_country_code_0_1.Copy_of_RW_Add_Country_Code.tOracleInput_1Process(Copy_of_RW_Add_Country_Code.java:891)
at roamware.copy_of_rw_add_country_code_0_1.Copy_of_RW_Add_Country_Code.runJobInTOS(Copy_of_RW_Add_Country_Code.java:1268)
at roamware.copy_of_rw_add_country_code_0_1.Copy_of_RW_Add_Country_Code.main(Copy_of_RW_Add_Country_Code.java:1136)
if((input_row.Country) != null && ((String)input_row.Country).contains("("))
output_row.Country = StringHandling.LEFT(input_row.Country,StringHandling.INDEX(input_row.Country,"("));
else if((input_row.Country) != null && !((String)input_row.Country).contains("("))
output_row.Country = input_row.Country;
If the scenario is that you also have the records that do not contain the character "(" and say if you want to pass them as it is to the output you can try out the below code in tJavaRow (You need to modify it as per your case): if((input_row.Country) != null && ((String)input_row.Country).contains("("))
output_row.Country = StringHandling.LEFT(input_row.Country,StringHandling.INDEX(input_row.Country,"("));
else if((input_row.Country) != null && !((String)input_row.Country).contains("("))
output_row.Country = input_row.Country;
I used exactly this code and keep getting the error:
Exception in component tJavaRow_1 (Extract_Country_Code)
java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 15
Do you have any idea why and what I can do? I cannot find any solution for this in the forum.
Thank you!