Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I can't find a java method that allows me to extract the whole string after the first space. For example, I have strings :
- word1 word2 word3
or
- word1 word 2
I want to have
- word2 word3
or
- word2
Thank you
I finally used your solution with tMap because I'm not sure if it works with tWarn. Thanks
try this
row1.name.contains(" ")?row1.name.substring(row1.indexOf(" ")+1):""
// this expression is used to check if the string contains blank space? if yes, extract the whole string after the first space, if no, return an empty string.
Regards
Shong
Thanks for the help @Shicong Hong, it will be useful if I encounter this case in a tMap.
But I forgot to mention that I am looking to do this in a tWarn! In the context of a joblet, I use a context variable where the first word is always the same, but depending on the job, the second word varies.
I tried that, but without success
I finally used your solution with tMap because I'm not sure if it works with tWarn. Thanks
I would use regex expressions to do that. There is a component tExtractRegexFields to handle regex.