Splitting Text into an Array

Discussion in 'ASP General' started by nvanhaaster@caitele.com, Feb 7, 2006.

  1. Guest

    Quick question, I need to split a large amount of text into an array
    everytime there is an enter (meaning line down) what is the code for
    the delimiter i would use..

    Example text

    Hello
    This is some sample
    text that needs to be put
    into an array
    by everytime
    we go to the next line

    sample code

    Array = Split(sampletext,?)
     
    , Feb 7, 2006
    #1
    1. Advertising

  2. wrote:
    > Quick question, I need to split a large amount of text into an array
    > everytime there is an enter (meaning line down) what is the code for
    > the delimiter i would use..
    >

    Probably vbCrLf, but it could be vbCr or vbLf. You'll need to try them to
    see which works.
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Feb 7, 2006
    #2
    1. Advertising

  3. Try using vbCrLf

    theArray = Split(sampletext, vbCrLf)

    It's the VB constant for carriage return + line feed.

    Ray at work


    <> wrote in message
    news:...
    > Quick question, I need to split a large amount of text into an array
    > everytime there is an enter (meaning line down) what is the code for
    > the delimiter i would use..
    >
    > Example text
    >
    > Hello
    > This is some sample
    > text that needs to be put
    > into an array
    > by everytime
    > we go to the next line
    >
    > sample code
    >
    > Array = Split(sampletext,?)
    >
     
    Ray Costanzo [MVP], Feb 7, 2006
    #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. John Ericson
    Replies:
    0
    Views:
    431
    John Ericson
    Jul 19, 2003
  2. Mark
    Replies:
    0
    Views:
    447
  3. John Dibling
    Replies:
    0
    Views:
    420
    John Dibling
    Jul 19, 2003
  4. Kai Jaensch
    Replies:
    26
    Views:
    721
    Jerry Coffin
    Jan 18, 2004
  5. basi
    Replies:
    35
    Views:
    686
    Adam i Agnieszka Gasiorowski FNORD
    Dec 3, 2005
Loading...

Share This Page