Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Posted
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...
qrt

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...