How to join list of strings with a separator using Apex in Salesforce?
Sample Code:
- List < String > strList = new List < String > { 'Test 1', 'Test 2', 'Test 3' };
- String str = String.join( strList, ', ' );
- system.debug( 'Joined with coma is ' + str );
Output:
No comments:
Post a Comment