Code:
Console.WriteLine("Input a string ");
String data = Console.ReadLine();
sr = File.OpenText(@"C:\username.txt");
String st = sr.ReadToEnd();
?????
thanks
|
Contributor
|
|
| 10Apr2007,18:06 | #1 |
|
How to search for a string in a file. As string might be somewhere in the middle of text file.
Code:
Console.WriteLine("Input a string ");
String data = Console.ReadLine();
sr = File.OpenText(@"C:\username.txt");
String st = sr.ReadToEnd();
?????
thanks |
|
Go4Expert Founder
|
![]() |
| 10Apr2007,18:24 | #2 |
|
use st.Contains
|
|
Contributor
|
|
| 10Apr2007,18:26 | #3 |
|
Shabbir Brother you are the star. Thanks a million
|
|
Contributor
|
|
| 10Apr2007,18:31 | #4 |
|
One more question is
"How to find a position of that string in a file"? Rgds, |
|
Contributor
|
|
| 10Apr2007,18:44 | #5 |
|
I got the answer for position thanks anyway
|