split method problem

Ace Master

Centurion
Joined
Aug 28, 2003
Messages
140
Hi.

I know how to make the split for a vbtab for example but can't make it working if I want to make the split for a tab and for each element which start with "#"

this is my code :
Visual Basic:
        Dim my As New System.IO.StreamReader("test.txt")
        Dim Line As Object

        Line = my.ReadToEnd
        my.Close()
        info1 = Line.split(vbtab)

How is possible to see if an element from that text file start with "#" and if so to ignore him and not to put in the array.

thanks
 
As far as I know there ain't any methods to filter strings while using the split function.
The only thing you could do is split your string and afterwards check your array and delete all itmes starting with #. But I bet you thought about that already.

Voca
 
Have a look at the RegEx class in the System.Text.RegularExpressions namespace. It's constructor takes a string representing a regular expression. The object created exposes a Split methode.... Can't tell you exactly how to solve your problem, but I guess the help files on RegEx could help you on the way. Regular expressions are very powerfull and are used in languages such as Perl...
 
Back
Top