Salesforce Fact #516 | Delete all white spaces in apex string

In Apex, we have the trim() function to remove the leading and trailing spaces from the string. But what if we want to remove all the white spaces from the string. There is a method deleteWhitespace().

Reference: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_System_String_deleteWhitespace

Attached are the screenshots.





Comments

Popular posts from this blog

Salesforce Fact #192 | Call batch apex from flow

Salesforce Fact #457 | Get current user role name in flow