Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
karandama2006
Creator
Creator

replace multiple special characters

Hi All , 

How can we replace multiple special characters or chain the replaceAll statement.

 

For eg : 

I want to replace ß with s

and ° with ? 

in the same column 

 

is there any chaining which we could do ? 

 

For eg : 

row1.theStringYouWishToTransform.replaceAll("[ß]", "s").replaceAll("[°]", "?") 
 
or we need to use two tmaps ? (Hopefully not)
Labels (2)
1 Solution

Accepted Solutions
TRF
Creator III
Creator III

Just 1 tMap with the following expression is enough:

(row1.theStringYouWishToTransform.replaceAll("ß", "s")).replaceAll("°", "?") 

If you don't have anything else to do inside the tMap, a single tJavaRow is better:

output_row.theStringYouWishToTransform = (input_row.theStringYouWishToTransform.replaceAll("ß", "s")).replaceAll("°", "?");

 

View solution in original post

4 Replies
TRF
Creator III
Creator III

Just 1 tMap with the following expression is enough:

(row1.theStringYouWishToTransform.replaceAll("ß", "s")).replaceAll("°", "?") 

If you don't have anything else to do inside the tMap, a single tJavaRow is better:

output_row.theStringYouWishToTransform = (input_row.theStringYouWishToTransform.replaceAll("ß", "s")).replaceAll("°", "?");

 

TRF
Creator III
Creator III

@karandama2006, does this help?

If so, thank's to mark your case as solved.

karandama2006
Creator
Creator
Author

Yes it helps , Thank you 

TRF
Creator III
Creator III

You're welcome!