2 Replies Latest reply on Mar 10, 2009 9:05 AM by drmaves

    Extract email address elements

    drmaves
      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.
        • 1. Re: Extract email address elements
          Level 7
          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','@')
          • 2. Re: Extract email address elements
            drmaves Level 1
            Thanks Ian. I wasn't aware of those functions.