Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can someone explain why StringHandling.LEN returns -1 in below scenario?
StringHandling.LEN(col1) return -1 when value of col1 is null.
Hi
You can look into the source code of this function in Repository-->Code-->Routine-->System-->StringHandling.
public static int LEN(String string) {
return string == null ? -1 : string.length();
}
To avoid the value is -1 if it is null, you can set it to 0 with this expression on tMap.
row1.columnName==null?0:StringHandling.LEN(row1.column)
Regards
Shong
Hi
You can look into the source code of this function in Repository-->Code-->Routine-->System-->StringHandling.
public static int LEN(String string) {
return string == null ? -1 : string.length();
}
To avoid the value is -1 if it is null, you can set it to 0 with this expression on tMap.
row1.columnName==null?0:StringHandling.LEN(row1.column)
Regards
Shong
Thank you @Shicong Hong