Click here to Skip to main content
15,906,766 members
Home / Discussions / C#
   

C#

 
GeneralRe: Comparing two ArrayLists ? Pin
Guffa22-Apr-08 10:43
Guffa22-Apr-08 10:43 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 10:57
dennycrane22-Apr-08 10:57 
GeneralRe: Comparing two ArrayLists ? Pin
Christian Graus22-Apr-08 12:06
protectorChristian Graus22-Apr-08 12:06 
GeneralRe: Comparing two ArrayLists ? Pin
Guffa22-Apr-08 12:12
Guffa22-Apr-08 12:12 
AnswerRe: Comparing two ArrayLists ? Pin
Judah Gabriel Himango22-Apr-08 11:52
sponsorJudah Gabriel Himango22-Apr-08 11:52 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 12:25
dennycrane22-Apr-08 12:25 
GeneralRe: Comparing two ArrayLists ? Pin
Judah Gabriel Himango22-Apr-08 18:55
sponsorJudah Gabriel Himango22-Apr-08 18:55 
GeneralRe: Comparing two ArrayLists ? Pin
Anthony Mushrow22-Apr-08 12:14
professionalAnthony Mushrow22-Apr-08 12:14 
I'd go for:

List<string> correctSpellings;
List<string> userSpellings

correctSpellings.Add("string1");
...
userSpellings.Add(textBox.Text);
...

for(int i=0; i<userspellings.length; i++) {
   if(String.Compare(userSpellings[i], correctSpellings[i], true) == 0)
       //correct spelling
   else
      //incorrect spelling
}


String.Compare compares two strings, if they are equal then it returns 0. The 'true' part is to ignore case.
If your NOT going to ignore case, then you may as well just use if(userSpellings[i] == correctSpelling[i])

My current favourite word is: Bacon!
-SK Genius


GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 12:40
dennycrane22-Apr-08 12:40 
GeneralRe: Comparing two ArrayLists ? Pin
Anthony Mushrow22-Apr-08 12:44
professionalAnthony Mushrow22-Apr-08 12:44 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 12:55
dennycrane22-Apr-08 12:55 
GeneralRe: Comparing two ArrayLists ? Pin
Anthony Mushrow22-Apr-08 13:01
professionalAnthony Mushrow22-Apr-08 13:01 
GeneralRe: Comparing two ArrayLists ? Pin
Guffa22-Apr-08 13:16
Guffa22-Apr-08 13:16 
GeneralRe: Comparing two ArrayLists ? Pin
Anthony Mushrow22-Apr-08 13:24
professionalAnthony Mushrow22-Apr-08 13:24 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 13:39
dennycrane22-Apr-08 13:39 
GeneralRe: Comparing two ArrayLists ? Pin
dennycrane22-Apr-08 13:32
dennycrane22-Apr-08 13:32 
GeneralOk, im confused. Pin
Anthony Mushrow22-Apr-08 13:37
professionalAnthony Mushrow22-Apr-08 13:37 
GeneralRe: Ok, im confused. Pin
dennycrane22-Apr-08 14:36
dennycrane22-Apr-08 14:36 
QuestionHow i can block the incomming network traffic using C# .NET Pin
Tahir Abbasi22-Apr-08 8:16
Tahir Abbasi22-Apr-08 8:16 
AnswerRepost ignore Pin
led mike22-Apr-08 8:39
led mike22-Apr-08 8:39 
AnswerRe: How i can block the incomming network traffic using C# .NET Pin
Pete O'Hanlon22-Apr-08 8:49
mvePete O'Hanlon22-Apr-08 8:49 
GeneralRe: How i can block the incomming network traffic using C# .NET Pin
Paul Conrad22-Apr-08 15:28
professionalPaul Conrad22-Apr-08 15:28 
Generalproblems splitting string Pin
stephan_00722-Apr-08 7:55
stephan_00722-Apr-08 7:55 
GeneralRe: problems splitting string Pin
led mike22-Apr-08 8:40
led mike22-Apr-08 8:40 
GeneralRe: problems splitting string Pin
Guffa22-Apr-08 8:46
Guffa22-Apr-08 8:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.