function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sai.sfsai.sf 

Replace single Quotes

Hi All,

 

   I need to replace single quotes from text field with empty string  in formula field like Sam's to Sams

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
colemabcolemab

You do know this is the apex code board right? :)

 

Look at the formula functions documentation and notice the SUBSTITUTE function.  You can pass a blank string as your replacement to replace it with nothing.

All Answers

colemabcolemab

Please read the string methods documentation located here.  I think you will find the .replace method useful.

sai.sfsai.sf

Thanks Colemab for your reply.But i need it in formula field not apex

colemabcolemab

You do know this is the apex code board right? :)

 

Look at the formula functions documentation and notice the SUBSTITUTE function.  You can pass a blank string as your replacement to replace it with nothing.

This was selected as the best answer
sai.sfsai.sf

Thanks Colemab.Here is the solution SUBSTITUTE(textfield__c,"'","")