Play Games

Search This Blog

Thursday, December 26, 2013

How to remove spaces from a string in salesforce

DeleteWhitespace() is used to remove all the spaces in a string.

For example "How to remove" is a string.In order to remove spaces do the following.

String str = 'How to Remove';
system.debug(str.deleteWhitespace()); //this line will give output as : HowtoRemove



No comments:

Post a Comment