Getting index of a String in list

I just need to get the index of a certain string in my list. I am currently using ListName.GetIndex(String) but it tells me that best overload for the method is not compatible with the argument(string). I cannot figure out why this is happening and would really appreciate some help.

Cheers

Show your actual code that isn't working: What kind of list do you actually talk about? The generic List inside the System.Collections.Generic namespace doesn't have a method called GetIndex. It only has the IndexOf method.

1 Answer

1

int index = list.IndexOf(value);