string word = "Hello";
int where = word.IndexOf("e");
// int where returns index number where the letter "e" is located.
// --0-1-2-3-4-- < Index number
// --H-e-l-l-o-- < Word
// In this case, the letter "e" is located in the index number 1
// index starts from zero: G-0, e-1, e-2, k-3, s-4, F-5
string str = "GeeksForGeeks";
// if character exists
str.IndexOf('F'); // result: 5 as 'F' exists at 5th index(zero-based)
// if character doesn't exist
str.IndexOf('M'): // result: -1 as 'M' doesn't exist in 'GeeksForGeeks'
int index = System.Array.IndexOf(array, item);