// 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'