CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Location
    India
    Posts
    10

    How to read strings from a text file

    I want to read indivisual character strings in a single row from a text file. The strings are separated by white space. What command is available in VB to read those strings. I dont want to use Line Input to read entire line and then break-up that line into individual strings.
    Help me.
    thanks in advance

    AmritPalSingh
    MTech Production
    IIT Delhi
    India
    110029

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to read strings from a text file

    dim a() as string
    a = split(line, " ")
    a(0) contains first element
    a(1) second...

    sample:

    Dim a() as string
    a = Split("this is a test")
    MsgBox a(0)



    requires VB 6


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

Featured