Slightly better version (untested):

static List<T> removeDuplicates(List<T> inputList)
{
 Dictionary<T, int> uniqueStore = new Dictionary<T, int>();
 List<T> finalList = new List<T>();

 foreach (T currValue in inputList)
 {
  if (!uniqueStore.ContainsKey(currValue))
  {
   uniqueStore.Add(currValue, 0);
   finalList.Add(currValue);
  }
 }
 return finalList;
}


On 25 Nov, 18:08, rhaazy <[EMAIL PROTECTED]> wrote:
> static List<string> removeDuplicates(List<string> inputList)
> {
> Dictionary<string, int> uniqueStore = new Dictionary<string, int>();
> List<string> finalList = new List<string>();
>
> foreach (string currValue in inputList)
> {
> if (!uniqueStore.ContainsKey(currValue))
> {
> uniqueStore.Add(currValue, 0);
> finalList.Add(currValue);
>
> }
> }
> return finalList;
> }
>
> You may have to adjust this to meet your specific needs, but the
> concept is simple enough to demonstrate.
> You need to create a new list of the same type and asign it the value
> of what is returned from the removeDuplicates function.
>
> On Nov 25, 12:58 pm, Cerebrus <[EMAIL PROTECTED]> wrote:
>
>
>
> > Not until you learn to type in proper case.
>
> > On Nov 25, 3:27 pm, TARAK <[EMAIL PROTECTED]> wrote:
>
> > > CAN ANY ONE PLEASE SUGGEST ME WHAT I NEED TO DO...
>
> > > WITH REGARDS- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Reply via email to