Read txt file between symbols
I am working on a program, and need a way to store data. So I was thinking of making a text file like so.
name:david:lastname: offerman:
So I need it to read in between name: and :
Or if someone could walk me through how to read XML that would be great and better.
Re: Read txt file between symbols
i'd use a text file + regex:
vb Code:
Dim testStr As String = "name:david:lastname:offerman:"
Dim rx As New Regex("(?<=name\:).+?(?=\:)")
For Each m As Match In rx.Matches(testStr)
MsgBox(m.Value)
Next
don't forget to import regex:
vb Code:
Imports System.Text.RegularExpressions
Re: Read txt file between symbols
Thank you SO much. This did the trick, but I should of thought better about lastname since it comes up, But I changed it to last so its all good. Thanks.