Well, basically i am required to open files and compare them, n try to find any sort of similar words that occur in both files.
I'm able to open and store the files as arraylists. Then, basically, i've written my own method which removes all tabs, newlines, etc.. and stores these results into a new arraylist, i.e: this being the arraylists i work with( without any extra white spaces, etc...)
When, i try to compare files using a for loop it just compares the last character of my files(arraylist). and returns the result.
Can't figure out why is it not doing for each and every character.
Also, this is the same problem when i try to display the contents of my file(arraylist) in a textbox, it just displays the last character, but not each and every item.
Below, is my method i used to compare the two files.
Plzzzzzz, help me out, n tell me what to do next or do i need to try something totally different.
Your, help wud be most appreciated.
// The button i click to compare.
private void compare_Click(object sender, System.EventArgs e)
// detect1 being my first arraylist
foreach(string compare in detect1)
//detect2 being my second file(arraylist).
resultlabel.Text="\nThe word "+compare+" of the first file, is at position "+index1+
" from start, in the second file.";
resultlabel.Text="Sorry, no matches found !!!";
Thanks guys ...
Edited by rahulsinghh, 11 March 2006 - 10:38 AM.