Does it look for the correct item or does it look for all the Items which contains the entry.
Even though I know the answer intuitively I just thought lemme confirm that with a simple program.
The Program is as follows:
***************************************************************************************************
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main (string[] args)
{
List
intList.Add(100);
intList.Add(11);
intList.Add(111);
if(intList.Contains(1))
Console.WriteLine("one is present");
if(intList.Contains(11))
Console.WriteLine("11 is present");
if(intList.Contains(100))
Console.WriteLine("100 is present");
}
}
}
***************************************************************************************************
The output is :
11 is present
100 is present
So it looks for the *exact* Item
No comments:
Post a Comment