• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Extract email address elements

Explorer ,
Mar 10, 2009 Mar 10, 2009

Copy link to clipboard

Copied

I would like to extract the two elements of an email address, for example, if the email address is joe@domain.com I would like to set the variable 'user' to 'joe' and the variable 'domain' to 'domain.com'. How can I extract everything before the @ sign and everything after the @ sign?

Thanks for your help.
TOPICS
Advanced techniques

Views

310

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 10, 2009 Mar 10, 2009
drmaves wrote:
> I would like to extract the two elements of an email address, for example, if
> the email address is joe@domain.com I would like to set the variable 'user' to
> 'joe' and the variable 'domain' to 'domain.com'. How can I extract everything
> before the @ sign and everything after the @ sign?
>
> Thanks for your help.
>

With string manipulation functions of you choice, all of which are well
defined in the documentation available with your installation and the
internet.

Bu...

Votes

Translate

Translate
LEGEND ,
Mar 10, 2009 Mar 10, 2009

Copy link to clipboard

Copied

drmaves wrote:
> I would like to extract the two elements of an email address, for example, if
> the email address is joe@domain.com I would like to set the variable 'user' to
> 'joe' and the variable 'domain' to 'domain.com'. How can I extract everything
> before the @ sign and everything after the @ sign?
>
> Thanks for your help.
>

With string manipulation functions of you choice, all of which are well
defined in the documentation available with your installation and the
internet.

But since I am avoiding work I'll share my favorite for this.

user = listFirst('joe@domain.com','@')
domain = listLast('joe@domain.com','@')

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 10, 2009 Mar 10, 2009

Copy link to clipboard

Copied

LATEST
Thanks Ian. I wasn't aware of those functions.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation