If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

First you're going to want to use string.Split(Char(13)) or something to that effect to split your incoming string into an array of strings, one for each line. Then you're going to use string.Contains("10.1.2.3") which returns a bool that tells you whether the string contains that sub string.

I personally recommend C# over VB, they both use the same libraries and object structures for the most part, however, in general, C# coders will get a somewhat higher pay for similar jobs. It all comes down to the perceived 'purpose' of the language even though they both can do the same exact thing. One will assume a C# coder has more experience, as C# is more related to the C/C++, which is used by most experts on large scale projects, while VB is often the first language a programmer learns, and is more related to simpler, business applications. But this all of course is just my opinion.

after that, you would do the Split() on the string to break each of the comma separated values into their own.

Edit: oops, that was c#. here is the VB equivalent (May not be 100&#37; right. havent done vb in ages)

Code:

Private Function ReservationFinder(comp As String) As String
Dim tr As TextReader = New StreamReader("c:\\file.csv")
Dim input As String = Nothing
Do While tr.Peek() <> -1
If String.Contains(comp) Then
Return String
End If
End While
End Function

Last edited by mungyun; August 11th, 2011 at 09:58 PM.

I believe in making the world safe for our children, but not our childrenís children, because I donít think children should be having sex. -- Jack Handey