trimming a variable.

Discussion in 'ASP General' started by mario c, Jul 21, 2003.

  1. mario c

    mario c Guest

    I need to trim a variable to have everything after 4 chars in a string.

    IE:

    var_temp = 200:16:1234567890

    i want everything after 200: to be a variable.

    I cannot use:

    var_new = right(var_temp,14)

    because the string is a different length everytime.
    I just dont know this function. please help :D

    Mario C

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    mario c, Jul 21, 2003
    #1
    1. Advertising

  2. mario c

    SPA Guest

    Use the mid function in vbscript
    Mid(string, start[, length])

    var_string = mid(var_temp, 5)

    If you know the length of how much you need to extract after the 4th
    character, you can specify that too

    HTH

    SPA

    "mario c" <> wrote in message
    news:#...
    >
    > I need to trim a variable to have everything after 4 chars in a string.
    >
    > IE:
    >
    > var_temp = 200:16:1234567890
    >
    > i want everything after 200: to be a variable.
    >
    > I cannot use:
    >
    > var_new = right(var_temp,14)
    >
    > because the string is a different length everytime.
    > I just dont know this function. please help :D
    >
    > Mario C
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    SPA, Jul 22, 2003
    #2
    1. Advertising

  3. mario c

    mario c Guest

    mario c, Jul 22, 2003
    #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. Steve C. Orr, MCSD

    Re: Trimming Blank Spaces in String

    Steve C. Orr, MCSD, Aug 9, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    461
  2. William Mild
    Replies:
    2
    Views:
    915
    William Mild
    Oct 23, 2003
  3. Brian Henry
    Replies:
    5
    Views:
    5,703
    Brian Henry
    Oct 21, 2004
  4. =?Utf-8?B?Q2hyaXM=?=

    Help trimming URL path

    =?Utf-8?B?Q2hyaXM=?=, Dec 14, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    3,041
    Juan T. Llibre [MVP]
    Dec 14, 2004
  5. Paul
    Replies:
    0
    Views:
    353
Loading...

Share This Page