Interrogating string for number of characters, response.writing identical number of characters on ne

Discussion in 'ASP General' started by Ken Fine, Feb 5, 2004.

  1. Ken Fine

    Ken Fine Guest

    Suppose I have strString. I want to determine the length of strString in #
    of characters, and write that number of characters on a subsequent line as a
    dummy character, say a hypen.

    In other words, I want to be able to dynamically create the following
    presentation in ASCII:

    Title title title title title title
    -------------------------

    Note that the number of hyphens equals the number of characters in "Title
    title title title ...", which would be stuffed in strString.

    Any help out there?

    BTW, thanks to all the smarties in the group who have helped me out over the
    past few years. The community has helped make my career.

    -KF
    Ken Fine, Feb 5, 2004
    #1
    1. Advertising

  2. Ken Fine

    Ray at Guest

    theString = "Title title title title title title"
    theChar = "-"
    Response.Write String(Len(theString), theChar)

    --

    Ray at home
    Microsoft ASP MVP


    "Ken Fine" <> wrote in message
    news:bvs99a$j7k$...
    > Suppose I have strString. I want to determine the length of strString in #
    > of characters, and write that number of characters on a subsequent line as

    a
    > dummy character, say a hypen.
    >
    > In other words, I want to be able to dynamically create the following
    > presentation in ASCII:
    >
    > Title title title title title title
    > -------------------------
    >
    > Note that the number of hyphens equals the number of characters in "Title
    > title title title ...", which would be stuffed in strString.
    >
    > Any help out there?
    >
    > BTW, thanks to all the smarties in the group who have helped me out over

    the
    > past few years. The community has helped make my career.
    >
    > -KF
    >
    >
    Ray at, Feb 5, 2004
    #2
    1. Advertising

  3. Ken Fine

    Ken Fine Guest

    Works like a charm, so simple, so sweet...Thanks again, Ray at home.

    -KF

    "Ray at <%=sLocation%> [MVP]" <myFirstNameATlane34dotKOMM> wrote in message
    news:...
    > theString = "Title title title title title title"
    > theChar = "-"
    > Response.Write String(Len(theString), theChar)
    >
    > --
    >
    > Ray at home
    > Microsoft ASP MVP
    >
    >
    > "Ken Fine" <> wrote in message
    > news:bvs99a$j7k$...
    > > Suppose I have strString. I want to determine the length of strString in

    #
    > > of characters, and write that number of characters on a subsequent line

    as
    > a
    > > dummy character, say a hypen.
    > >
    > > In other words, I want to be able to dynamically create the following
    > > presentation in ASCII:
    > >
    > > Title title title title title title
    > > -------------------------
    > >
    > > Note that the number of hyphens equals the number of characters in

    "Title
    > > title title title ...", which would be stuffed in strString.
    > >
    > > Any help out there?
    > >
    > > BTW, thanks to all the smarties in the group who have helped me out over

    > the
    > > past few years. The community has helped make my career.
    > >
    > > -KF
    > >
    > >

    >
    >
    Ken Fine, Feb 5, 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. boku
    Replies:
    2
    Views:
    18,408
    David R Brooks
    Apr 28, 2005
  2. Guest
    Replies:
    2
    Views:
    533
    Yan-Hong Huang[MSFT]
    Jul 28, 2003
  3. Joseph
    Replies:
    2
    Views:
    5,570
  4. Chumley the Walrus
    Replies:
    1
    Views:
    368
    Mark Rae
    Aug 12, 2004
  5. ElGordo
    Replies:
    4
    Views:
    2,098
    ElGordo
    Apr 28, 2005
Loading...

Share This Page