Look at these methods:

 

I believe you might want String.Equals

 

String.Compare

String.CompareTo

String.Equals

 

Instead of IndexOf

 

HTH 

 

--Eric

 

-----Original Message-----
From: Helge Thomas Hellerud [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 26, 2005 10:23 AM
To: AspNetAnyQuestionIsOk
Subject: [AspNetAnyQuestionIsOk] Check if a word exists in an string array

 

Hello,

I have a string array with words. How can I check if a specific word exists
in the array?

The problem with myArray.IndexOf(myArray, word) is that it returns > 0 if
the parameter word is a part of an element in the array (i.e. the word "in"
matches "invite"). I want to check if only the WHOLE word exists, not a part
of it.

Helge






  _____  

Yahoo! Groups Links

*         To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/> 
  

*         To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
e> 
  

*         Your use of Yahoo! Groups is subject to the Yahoo! Terms of
<http://docs.yahoo.com/info/terms/>  Service. 



[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to