CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2001
    Posts
    34

    String Manipulation

    I have a variant, like the following example

    cdnzc:\1.txtzc:\textfilesz

    what i want to do is take the string and split it into 3 seprate strings using the z to signify the end of 1 string

    can anyone tell me what code i need, or even come up with a better way of doing it, remembering that the strings will change length.



    -DAVE

  2. #2
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: String Manipulation

    if the delimiter is always the same you can use the split function to put the seperate string into an array


  3. #3
    Join Date
    May 2001
    Posts
    34

    Re: String Manipulation

    could you give me some more detail on this?

    Please

    thanx in advance

    -DAVE

  4. #4
    Join Date
    Feb 2000
    Location
    Ireland
    Posts
    808

    Re: String Manipulation

    [vbcode]
    Dim StringArray() As String
    Dim MyString As String
    MyString = "cdnzc:\1.txtzc:\textfilesz"

    StringArray = Split(MyString, "\")
    MsgBox StringArray(0)
    'etc etc
    [/vcode]


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