Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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
Champion II
Champion II

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
Champion II
Champion II

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
Champion II
Champion II

@karandama2006, does this help?

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

karandama2006
Creator
Creator
Author

Yes it helps , Thank you 

TRF
Champion II
Champion II

You're welcome!