Five Stars

Removing characters before first occurence of space using tMap

Hi Guys,
I just wanted to ask if is it possible to remove all the characters before the first occurrence of space in a string using tMap?
For example:
Input: "This is a sentence"
Ouput" "is a sentence"
Thanks! Smiley Very Happy
2 REPLIES
Ten Stars

Re: Removing characters before first occurence of space using tMap

Assuming your string column is named "col1", set your output column to: row1.col1.substring(row1.col1.lastIndexOf(' ')+1)
One Star

Re: Removing characters before first occurence of space using tMap

Variation : row1.col1.replaceAll("^.* ", "")