List<>.Exists()???
- From: "A" <a@home>
- Date: Tue, 4 Dec 2007 16:59:31 +1000
Hi,
I don't get this method... Could someone please explain it?
I have a number generator where I want to add the numbers to a List<long>.
Before I add each number, I want to make sure that the number does not
already exist. Sample code:
List<long> numlist = new List<long>();
long newNumber = generator.New(); // generates the new number
if (!numlist.Exists(newNumber)) // obviously does not work, that's my
problem.
numlist.Add(newNumber);
Can anyone help me?
Thank you in advance.
.
- Follow-Ups:
- Re: List<>.Exists()???
- From: Doug Forster
- Re: List<>.Exists()???
- From: Marc Gravell
- Re: List<>.Exists()???
- Prev by Date: Re: Multiple Event Handling Exception with COM Components
- Next by Date: Re: Multiple Event Handling Exception with COM Components
- Previous by thread: .NET Web Scrapper project
- Next by thread: Re: List<>.Exists()???
- Index(es):
Loading