[resolved] Replace multiple strings altogether

Four Stars

[resolved] Replace multiple strings altogether

I have this situation where I have to replace multiple strings with a single string value.
Information.replace("", "Resident Referral").
replace("", "Return Visitor");

Referral                 
Resident Referral
Resident Referrral -------------- Replace all three with Resident Referral
Return visitor
Return Visitor
Return Vistitor
Return Vistor ----------------- Replace all four with Return Visitor

Replace the string values where Refer is common with Resident Referral and replace the string values where Return is common with Return Visitor.
How can I get this done?

Accepted Solutions
One Star

Re: [resolved] Replace multiple strings altogether

Hi,
In tMap (or tJavaRow), use replaceAll with according regex, something like:
row1.Information.replaceAll("^.*Refer.*$", "Resident Referal").replaceAll("^.*Return.*$", "Return Visitor")

Check the syntax but that's the idea.
Regards,
TRF

All Replies
One Star

Re: [resolved] Replace multiple strings altogether

Hi,
In tMap (or tJavaRow), use replaceAll with according regex, something like:
row1.Information.replaceAll("^.*Refer.*$", "Resident Referal").replaceAll("^.*Return.*$", "Return Visitor")

Check the syntax but that's the idea.
Regards,
TRF