Problem removing double quotes in a string

Post your questions and help other users.

Moderator: Martin

Post Reply
houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

Problem removing double quotes in a string

Post by houdinix64 » 22 May 2017 07:55

Hello.

How can i removed double quotes ( " ) in a string using replaceAll function?

Thanks

User avatar
Martin
Posts: 4429
Joined: 09 Nov 2012 14:23

Re: Problem removing double quotes in a string

Post by Martin » 22 May 2017 18:54

Hi,

You can use the function replace to remove double quotes:

Code: Select all

text= "test\"test";
cleaned_text = replace(text, "\"", "");
or you can use single quotes to make the script more readable since the double quote needs not to be escaped using a backslash:

Code: Select all

text= "test\"test";
cleaned_text = replace(text, '"', '');
replaceAll on the other hand is more sophisticated since the second parameter is a regular expression and not a plain string.

Regards,
Martin

houdinix64
Posts: 33
Joined: 08 Mar 2013 12:45

Re: Problem removing double quotes in a string

Post by houdinix64 » 24 May 2017 04:47

Thanks Martin

Post Reply