formatting string

Discussion in 'ASP General' started by dave, Jul 14, 2004.

  1. dave

    dave Guest

    Hi There
    I have one string variable and value is stored something
    like this when I checked using
    Response.write st_toadd
    It displayed something like this
    "John Matthew" <>

    I want to grab only email address
    i.e. value between "<" and ">"
    and it should give me only

    what could be the syntax??

    thanx for help
    dave
    dave, Jul 14, 2004
    #1
    1. Advertising

  2. dave

    Bullschmidt Guest

    To get everything between the < and > in a string, perhaps try something
    like this:

    intFirstPos = InStr(strMyString, "<")
    intFinalPos = InStr(strMyString, ">")

    strEmail = Mid(strMyString, IntFirstPos + 1, intFinalPos - intFirstPos -
    1)

    Best regards,
    J. Paul Schmidt, Classic ASP Web Designer
    http://www.Bullschmidt.com
    Classic ASP Design Tips, ASP Web Database Demo, ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt, Jul 14, 2004
    #2
    1. Advertising

  3. dave

    dave Guest

    thanx

    >-----Original Message-----
    >To get everything between the < and > in a string,

    perhaps try something
    >like this:
    >
    >intFirstPos = InStr(strMyString, "<")
    >intFinalPos = InStr(strMyString, ">")
    >
    >strEmail = Mid(strMyString, IntFirstPos + 1,

    intFinalPos - intFirstPos -
    >1)
    >
    >Best regards,
    >J. Paul Schmidt, Classic ASP Web Designer
    >http://www.Bullschmidt.com
    >Classic ASP Design Tips, ASP Web Database Demo, ASP Bar

    Chart Tool...
    >
    >
    >*** Sent via Developersdex http://www.developersdex.com

    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
    dave, Jul 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lee Simpson

    Re: Formatting string in WHERE clause

    Lee Simpson, Jul 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,243
    Lee Simpson
    Jul 18, 2003
  2. Steve Hoyer

    Re: Formatting String in Datagrid

    Steve Hoyer, Apr 14, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,313
    Steve Hoyer
    Apr 15, 2004
  3. Andre Alexander Bell

    String formatting with the format string syntax

    Andre Alexander Bell, Sep 14, 2010, in forum: Python
    Replies:
    9
    Views:
    481
    Andre Alexander Bell
    Sep 15, 2010
  4. Andrew Berg
    Replies:
    13
    Views:
    1,260
    Andrew Berg
    Jul 11, 2011
  5. Victor Hooi
    Replies:
    3
    Views:
    103
    Chris Kaynor
    Nov 27, 2013
Loading...

Share This Page