Ace Master Posted December 17, 2003 Posted December 17, 2003 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 : 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 Quote
Voca Posted December 17, 2003 Posted December 17, 2003 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 Quote
Kurt Posted December 17, 2003 Posted December 17, 2003 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... Quote qrt
Ace Master Posted December 17, 2003 Author Posted December 17, 2003 I will take a look.. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.