[resolved] How to Substring a Large String in tMap

Six Stars

[resolved] How to Substring a Large String in tMap

Neither of these worked in tMap Expression Builder for strings larger than 46 characters. It seems that strings larger than 46 characters cannot be operated on. Is that correct?
This is what I'm trying to do. Through experimentation, it seems to throw errors once the "index" or "indexOf" is bigger than 46.
StringHandling.LEFT(row11.out,StringHandling.INDEX(row11.out,"=")) 
row11.out.substring(0, row11.out.indexOf("=")) 
For both I get a 
"String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1"
Does anyone know why it would do this? 

Accepted Solutions
Ten Stars

Re: [resolved] How to Substring a Large String in tMap

Strings should not be constrained to 46 characters.  Is it possible your schema is defining that column of input with length 46?
StringHandling.INDEX will return -1 if either of its arguments are null.  Are there any cases where row11.out is null?
indexOf returns -1 if the searched for character is not found.  Are there any instancens where row11.out does not contain "="?

All Replies
Ten Stars

Re: [resolved] How to Substring a Large String in tMap

Strings should not be constrained to 46 characters.  Is it possible your schema is defining that column of input with length 46?
StringHandling.INDEX will return -1 if either of its arguments are null.  Are there any cases where row11.out is null?
indexOf returns -1 if the searched for character is not found.  Are there any instancens where row11.out does not contain "="?
Six Stars

Re: [resolved] How to Substring a Large String in tMap

I think that, in the end, that some of the strings I had were null. 
The thing is that I didn't expect them in the output but I guess that is what happens sometimes! haha
Thanks,
Croix