Replace "char" from string by ""

From the following string shown replace “e” just before 2023 to “”.
I dont want to replace any other e

Hi @BHUSHAN_NAGAONKAR1

Store the data in a variable called Input. Then use the below expression to replace e.

- Assign -> Output = System.Text.RegularExpressions.Regex.Replace(Input.toString, "e(?=2023)", "")

Hope it helps!!

1 Like

You can check the below workflow for better understanding… @BHUSHAN_NAGAONKAR1

Hope you understand!!

1 Like

Thankyou for your quick response.

1 Like

It’s my pleasure… @BHUSHAN_NAGAONKAR1

Happy Automation!!

1 Like

Just an addition to this what if I have to replace using character index. Such as the position of might 5 or 6 depending. How will I do it?

If you have the Input as 12345e6 you want to replace the e with empty, then you can use the Substring function,

Check the below expression,

- Assign -> Input = "12345e6"
- Assign -> Output = Input.Replace(Input.Substring(5,1),"")

Check the below workflow,

Hope you understand!!

1 Like

Thankyou for your prompt response. Understood and worked as well

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.