Hi,
I am writing a program that needs to search particular strings in a text file. The strings are typed in a text box by the user and then when the text file is opened, using fileDialog, the program searches that file using the string in the text box. I have done this currently with the String->Contains function.
Here is the code I used currently
if(Form1::wordsearch->Text != "") {
String ^wrdsrch;
wrdsrch = Form1::wordsearch->Text;if (line->Contains(wrdsrch)) { ...
the last line in the if statement is the one that does the search. I want to make sure that the string is exactly and only exactly the same string in the document as the user put it. How do I write a piece of code that will match each letter for me and then if the letters don't match, go to the next word in the line and so on until an exact match has been found in that line of text. Then going on to the next line. I only need to know if the exact word is in a line of the document and then going on to the next line of that document.
This is in Visual C++ .net the express version from Microsoft.
Can anybody help me with this??
Thanks in advance,
Tony