Answers for "how to split string in apex"

1

how to split string in apex

String str = '[email protected]';
String[] str2 = str.split('@');
System.debug(str2[0]); // firstName.LastName
System.debug(str2[1]); // salesforce.com'
Posted by: Guest on March-02-2022

Browse Popular Code Answers by Language