I am sending an Http request who's body contains XML payload. Data sent over can have apostrophes which causes my palyload to error out. XML payload looks something like
<comments>testString</Ccomments>
where testString
is a string variable that contains apostrophes.
I tried using
string.escapeSingleQuotes(testString);
but this replaces '
with \'
I want to replace all apostrophes with '
Any suggestions?
a = a.replace('\'', ''');