Remove duplicate values through List Contain method
public string[] RemoveDuplicates(string[] inputArray)
{
List<string> distinctArray = new List<string>();
foreach (string element in inputArray)
{
if (!distinctArray.Contains(element))
distinctArray.Add(element);
}
return distinctArray.ToArray<string>();
}
Delete Duplicate elements through ArrayList Contain method
public string[] RemoveDuplicates(string[] inputArray)
{
System.Collections.ArrayList distinctArray = new System.Collections.ArrayList();
foreach (string element in inputArray)
{
if (!distinctArray.Contains(element))
distinctArray.Add(element);
}
return (string[])distinctArray.ToArray(typeof(string));
}