How Do I Find How Many Occurrences of ";" there are in a value?

Discussion in 'ASP General' started by MSUTech, Jun 7, 2005.

  1. MSUTech

    MSUTech Guest

    Hello,

    I am working on an asp page.. I would like to find out how many semi-colons
    exist in a request variable. I thought I could use something like INSTR,
    but, that just tells me WHERE the first occurrence is. Is there another way
    to find out HOW MANY occurrences there are within an entire variable?

    thanks,

    Chip
    MSUTech, Jun 7, 2005
    #1
    1. Advertising

  2. MSUTech

    McKirahan Guest

    "MSUTech" <> wrote in message
    news:...
    > Hello,
    >
    > I am working on an asp page.. I would like to find out how many

    semi-colons
    > exist in a request variable. I thought I could use something like INSTR,
    > but, that just tells me WHERE the first occurrence is. Is there another

    way
    > to find out HOW MANY occurrences there are within an entire variable?
    >
    > thanks,
    >
    > Chip


    UBound(Split(your_string,";"))
    McKirahan, Jun 7, 2005
    #2
    1. Advertising

  3. MSUTech

    Phill. W Guest

    "MSUTech" <> wrote in message
    news:...
    .. . .
    > I would like to find out how many semi-colons exist in a request variable.


    Just to be different ...

    sVar = Request.QueryString( "Var" )
    iLen = Len( sVar ) - Len( Replace( sVar, ";", "" ) )

    HTH,
    Phill W.
    Phill. W, Jun 8, 2005
    #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. Shabam
    Replies:
    2
    Views:
    2,020
    Joe Smith
    Nov 17, 2004
  2. Replies:
    5
    Views:
    451
    Andrea Desole
    Oct 7, 2005
  3. Pete
    Replies:
    1
    Views:
    879
    Martin Honnen
    Nov 27, 2004
  4. STA
    Replies:
    1
    Views:
    502
    Joe Kesselman
    Jun 27, 2006
  5. Mike
    Replies:
    3
    Views:
    324
    Tim Chase
    May 4, 2006
Loading...

Share This Page