deleteWhitespace() is used to remove spaces in a string in Salesforce.
Sample Code:
Sample Code:
String str = ‘Hello Hi’;
system.debug(str.deleteWhitespace()); //HelloHi
String str = ‘Hello Hi’;
system.debug(str.deleteWhitespace()); //HelloHi