Forum Discussion
Thanks for the suggestion tlkarish and that wasn’t exactly what I was looking for. Sorry for not being clear.
Using example $email is (xyz@test.com, abc@de.com, 13432@me.com)
I would like to return the following
$primaryEmail - xyz@test.com
$secondaryEmails - abc2de.com, 13432@me.com
Thanks in advance.
cjhoward18
4 years agoEmployee
You can use this expression given above to get the primary email:
$email.split(',')[0]
And this expression to extract the secondary emails after the primary:
$email.substr($email.indexOf(',') + 1)
keep in mind if there is no secondary email/comma in the given $email string the primary and secondary emails will be the same email.