Remove double quotes (") from a string

I have a string that contains double quotes, and I’d like to remove them, replacing each instance with an empty character. I’m looking for a way to accomplish this so that the double quotes are entirely removed from the text.

For example, if I have:

greetingText = “Welcome to the Team”

I want the result to be:

Welcome to the Team

How can I achieve this?

@Deepti_Hirave,

Simply use this.

greetingText = greetingText.Replace("""", "")

greetingText.Replace(“”“”, “”)

So if greetingText initially contains “Welcome to the Team”, this will result in cleanedText containing Welcome to the Team, with all double quotes removed.

Hi @Deepti_Hirave

greetingText = “Welcome to the Team”
new_text = System.Text.RegularExpressions.Regex.Replace(greetingText, "[""]","")

Hope it helps!!

Hi @Deepti_Hirave

Fallow the steps below. If I helped you, please mark it as solved.

1 Add an Assign activity.

2 In the To box, enter the variable that stores the string (for example, greetingText).

3 In the Value box, use the Replace function to remove the quotes, as in the following example:

greetingText = greetingText.Replace(“”“”, “”)

Explanation:

The first “”" represents a single double quote. We use three quotes so that UiPath understands that we want to include a literal double quote inside the function.

The second “” represents the empty character, which is the value that will replace the quotes.

When you run this code, all " in the string will be removed, and the greetingText variable will now contain the text without the double quotes.

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