How to Replace a character in a string using UiPath

Replacing a character, a special character, the word in a string is a very useful part of the automation process.

How do we replace the value in a string?

By using Replace method we will achieve this.

How you use the Replace method for a string variable in UiPath?

Let’s say we have a variable named strvariable.

strvariable = “Aditya designed rpalearners.com”.

Now in the above variable we will try to replace designed with founded.

How to Replace this value in strvariable?

Syntax:

strvariable = strvariable.Replace(s1,s2)

uipath

Here we are replacing “designed” with “founded”.

Where s1= designed-which is the string that we are replacing.

s2= founded- which is the string that needs to be replaced in the old value(s1).

The output looks like below:

uipath

Where designed is replaced by founded in strvariable.

This is how you replace any value in a string by using the Replace Method in UiPath.

Happy Learning!

Like this post then let your friends know about this-:

Leave a Reply

Your email address will not be published. Required fields are marked *