Premise: I have a list of string which I have to pass it from LWC to APEX and in APEX I have to put this List in SOQL where clause to get the data. Finally I have to return the SOQL result list back to LWC.
I'm using imperative way of calling the APEX method and sending the parameters to APEX. At LWC side I have used methodName({strLst: JSON.stringify(strLstLWC)});
In each of the record of "strLstLWC", I have some special characters. For example, one value could be 'A || B' while another value could be 'someText #### someOtherText'.
Problem: At APEX side I'm getting this list of string but all of my special characters are getting convereted into their respective ASCII values. For example, A || B
is getting converted into A || B
and so on. And to use these values in my SOQL I dont need the ASCII values.
I can use some regEx to convert special character to normal characters or else can use replaceAll to get the desired result, but is there any standard way of achieving this?
Note: I tried unescape methods of String but there was no luck.
System.debug('unescapeHtml3 ++++++ ' + a.unescapeHtml3());
System.debug('unescapeHtml4 ++++++ ' + a.unescapeHtml4());
System.debug('unescapeXml ++++++ ' + a.unescapeXml());
//System.debug('unescapeJava ++++++ ' + a.unescapeJava());
//System.debug('unescapeUnicode ++++++ ' + a.unescapeUnicode());