How to remove special characters from a string in apex.
Code:
selectedStatus = ApexPages.currentPage().getParameters().get(‘ideaStatus’);
value: ideastatus = “We like’s it”
I want to remove the ‘ from the value of ideastatus.
I am trying selectedStatus.replace(“‘”,””);
But its not working.
Can anybody suggest how?
Try
However please note that “We like’s it” is grammatically incorrect – it should be “We like it”. So you shouldn’t have to worry about the apostrophe in this case.