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. Advertisements

  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. Advertisements

  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. Advertisements

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. Guest
    Replies:
    2
    Views:
    696
    Yan-Hong Huang[MSFT]
    Jul 28, 2003
  2. Joseph
    Replies:
    2
    Views:
    5,867
  3. berthelot samuel

    number of characters in a string

    berthelot samuel, Nov 23, 2003, in forum: C Programming
    Replies:
    6
    Views:
    483
    Irrwahn Grausewitz
    Nov 24, 2003
  4. Preben Randhol
    Replies:
    8
    Views:
    519
    Leo Kislov
    Oct 11, 2006
  5. happy

    read a string..writing a string

    happy, Feb 11, 2005, in forum: C Programming
    Replies:
    3
    Views:
    469
    Thomas Matthews
    Feb 12, 2005
  6. Greg Hurrell
    Replies:
    1
    Views:
    324
    Greg Hurrell
    Feb 26, 2007
  7. Eu Fe
    Replies:
    5
    Views:
    190
    Brian Candler
    May 19, 2007
  8. Replies:
    54
    Views:
    684
    Michele Dondi
    Jan 16, 2005
Loading...