Play Games

Search This Blog

Thursday, September 15, 2022

difference() of String class in apex Salesforce

 The difference() returns the difference between the current String and the specified String.

Example:

String str1 = 'Hello Suresh';

String str2 = 'Hello Mahesh';

String difference = str1.difference(str2);

system.debug('Difference : '+difference);

Output:

Note: It's case sensitive.

No comments:

Post a Comment