Page 1 of 1

Problem removing double quotes in a string

Posted: 22 May 2017 07:55
by houdinix64
Hello.

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

Thanks

Re: Problem removing double quotes in a string

Posted: 22 May 2017 18:54
by Martin
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

Re: Problem removing double quotes in a string

Posted: 24 May 2017 04:47
by houdinix64
Thanks Martin