Results 1 to 5 of 5

Thread: Split

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    Can someone explain how to use it?
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    It's pretty simple.

    Code:
    SourceString = "Hello|How|Are|You"
    Delimiter = "|"
    StringArray = Split(SourceString, Delimiter)
    For i = 0 to Ubound(StringArray - 1)
    MsgBox StringArray(i)
    Next
    Put this code into any procedure and run it. StringArray(0) will be "Hello". StringArray(1) will be "How", and so on.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3
    Guest
    Code:
    Dim i As Long
    Dim MyArray() As String
    Dim MyData As String
    
    MyData = "hello:dude:you:are:cool"
    MyArray() = Split(MyData, ":")
    For i = 0 To 5
    MsgBox MyArray(i)
    Next
    I hope this helps


  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    for each n in split("another cool sample you must test"," ")
      msgbox n
    next n
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    Thanks guys
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width