Are special characters removed?
How to remove special characters from a string at the top.
code: selectedStatus = ApexPages.currentPage (). getParameters (). get ('ideaStatus');
Meaning: ideastatus = "We like it"
I want to remove 'from ideastatus value.
I am trying selectedStatus.replace ("'", "");
But it doesn't work.
Can anyone suggest how?
+3
Kp Gupta
source
to share
2 answers
Try
selectedStatus.replace('\'', '')
Note, however, that "We like this" is grammatically incorrect - it should be "We like this." Therefore, you do not need to worry about the apostrophe in this case.
+3
naomi
source
to share
If you want to pass and receive exact values from a URL, you must URL-encode and decode those values. The URLEncode and URLDecode methods will handle all special characters.
0
eprasu
source
to share