Click here to Skip to main content
13,558,022 members
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

8K views
5 bookmarked
Posted 13 Jun 2011
Licenced CPOL

Trick when using Array.Contains()

, 13 Jun 2011
The Array class already contains this capability with no casting required. The IndexOf method is a static one that returns the index of the value and a -1 if it doesn't exist.Here is an example:exists = Array.IndexOf(arr, "item") >= 0

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

20 Jun 2011
Kiran Sonawane
1 alternative  
A trick when using Array.Contains()

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ctznkane
United States United States
No Biography provided

Pro
Pro
| | Privacy | Terms of Use | Mobile
Web04-2016 | 2.8.180515.1 | Last Updated 13 Jun 2011
Article Copyright 2011 by Ctznkane
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid