I am trying to search through a List of Strings to see if a specific String appears more than once.
Basically I have an if statement that I want to be True is the List contains the String at least twice
List:
dog
cat
mouse
dog
String: “dog”
if (List.Contains(“dog”)
would work if I am just checking for any instance of dog but I need to check for more than one.
Also could be like this if you will need to find all duplicates in the list: listOfDuplicates = list.GroupBy(Function(m) m).Where(Function(g) g.Count() > 1).Select(Function(g) g.Key).ToList