How to remove all the formats from Phone Number in Salesforce? April 15, 2019April 9, 2023InfallibleTechie Admin Sample Code: String num = '(123) 456-7894'; system.debug( num.replaceAll( '[^0-9]', '' ) ); Debug Log: