P
Paul
Hi,
I'm trying to create an array containing the entire contents of a text file
and delimit the elements using vbCrLf.
The text file is like this....
-text1
-text2
-text3
etc...
I can read the file in like this...
Dim TEST As New StreamReader("C:\test.txt")
Dim line As String = TEST.ReadLine()
While Not line = Nothing
Console.WriteLine(line)
line = TEST.ReadLine()
End While
What i'm trying to do is load each element of the text file, in this case
each line (-text1, -text2, -text3 etc..) into an array which I can later use
to compare another string (let's say, strA) with and remove, if found, any
occurances of an array element from strA. So for example, if strA contains
"this is a string -line2" then the "-text2" part of is removed from strA
using strA = strA.Replace(Whatever match was found, "")
All I have at the moment is how to read the file in, as i wrote above, so
any help with the creation of the array and the comparing against another
string is much appreciated.
Cheers,
Paul
I'm trying to create an array containing the entire contents of a text file
and delimit the elements using vbCrLf.
The text file is like this....
-text1
-text2
-text3
etc...
I can read the file in like this...
Dim TEST As New StreamReader("C:\test.txt")
Dim line As String = TEST.ReadLine()
While Not line = Nothing
Console.WriteLine(line)
line = TEST.ReadLine()
End While
What i'm trying to do is load each element of the text file, in this case
each line (-text1, -text2, -text3 etc..) into an array which I can later use
to compare another string (let's say, strA) with and remove, if found, any
occurances of an array element from strA. So for example, if strA contains
"this is a string -line2" then the "-text2" part of is removed from strA
using strA = strA.Replace(Whatever match was found, "")
All I have at the moment is how to read the file in, as i wrote above, so
any help with the creation of the array and the comparing against another
string is much appreciated.
Cheers,
Paul