Results 1 to 2 of 2

Thread: Reading a multilined string

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    California
    Posts
    115
    I will have this string that will be multilined:

    SomeString =
    this is line 1
    this is line 2
    this is line 3


    How can I read each line of this string and send each line to a listbox (List1.Additem)

    I hope that makes sense, if not, just ignore.

    Thanks,
    Ryan


  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Code:
    Dim words() As String
    Dim i As Integer
    Dim mystring As String
    mystring = "1" & vbCrLf & "2" & vbCrLf & "3"
    words = Split(mystring, vbCrLf)
    For i = 0 To UBound(words)
        List1.AddItem words(i)
    Next
    That should split the string properly into a listbox.

    Hope that helps,
    D!m

    [Edited by Dim on 08-24-2000 at 07:55 PM]
    Dim

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