Using a SubStringBefore(' ') and SubStringAfter(' ')

SubStringBefore(' ')  and SubStringAfter(' ')



Simple displaying of the firstName and lastName of an account object using Apex in Salesforce. Using a SubStringBefore(' ')  and SubStringAfter(' ') .

Apex code :

list<account> a = [select id,name from account limit 10];

for(account aa  : a){
    system.debug('firstName : '+ aa.name.SubStringBefore(' '));
    system.debug('LastName : '+ aa.name.SubStringAfter(' '));

}




We need your support,Please share/Like us on Facebook ⛅
Using a SubStringBefore(' ') and SubStringAfter(' ') Using a SubStringBefore(' ')  and SubStringAfter(' ') Reviewed by dasfrogpractice on 01:29 Rating: 5

No comments:

Theme images by mariusFM77. Powered by Blogger.
Youtube Channel Image
Dasfrog Subscribe To watch more Salesforce Training
Subscribe