How to replace the specifc part of one strings to the specific part of other string

Hii Team,
I have one string so I want to replace the specific part of a string like ( “WBB” or “W B B”) with (" WEST BANK BERBICE" ) in the same string .please give me a solution to solve the issue
for example, Input is: 121 TESTADDRESS W B B D EDWARD VILLAGE WEST BANK BERBICE here W B B or WBB is replaced with WEST BANK BERBICE
finally, the output will be like is:121 TESTADDRESS WEST BANK BERBICE D EDWARD VILLAGE WEST BANK BERBICE

Please help me to solve the issue ASAP.
thanks,

1 Like

Hi

Let’s do it with a simple expression

Hope the below expression in a assign activity would help you resolve this

If you have the input in strinput then

Stroutput = strinput.ToString.Replace(“WBB”, “WEST BANK BERBICE”).Replace(“W B B”, “WEST BANK BERBICE”).ToString.Trim

Where stroutput is a string variable holding your output

Cheers @nagasneha

We can try to find generic patterns for using it later within a Regex.Replace e.g.

Thank you @Palaniyappan for your quick response,
but I have an excel sheetimage like this, so here in a B column whatever data is there(W C D or WCD) is replaced with column A value in the same string i already sent the output like that?? so please help me
thanks.

So all the values like WCD or W C D in column B has to be replaced with column A value ah

Can you elaborate the requirement and the expected output as well

@nagasneha

Thanks, @Palaniyappan Exactly, Whatever value in the column B either W B B or WBB the string is replaced with the column A string in the output
Input: 121 TESTADDRESS W B B D EDWARD VILLAGE WEST BANK BERBICE
in the input, WBB or W B B is replaced with WEST BANK BERBICE

Output:121 TESTADDRESS WEST BANK BERBICE D EDWARD VILLAGE WEST BANK BERBICE like this.
so this replacement will work multiple names as well please referimage

Hi,

Attaching the work flow. please try and let me know if it works. i have modified the mapping excel to retrieve the city names. please find the mapping excel in the folder itself. thanks.
Test studio.zip (9.4 KB)

Regards,
Kirankumar.