CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Text Separation

  1. #1
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    18

    Text Separation

    Hi, I need to retrieve a string from a database which is comprised of several information. An example is 'USA/FRA/GER'. Now, I need to break these info into 'USA', 'FRA' and 'GER' respectively. How do I identify these info and separate them?
    Thanks

    Rgds
    Lynn


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Text Separation

    If you're using VB6, you can use the 'Split' function :


    Dim s as string
    Dim sArray() as string
    Dim l as Long

    s = "USA/FRA/GER"

    sArray = Split(s, "/")

    for l = LBound(sArray) to UBound(sArray)
    MsgBox sArray(l)
    next




    That 'chops' up the delimeted string into an array for you.


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  3. #3
    Join Date
    Sep 1999
    Location
    Singapore
    Posts
    18

    Re: Text Separation

    Thanks Chris!

    Lynn


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