Method
IndexOf searches for a case-sensitive string and returns an item.
Method
IndexOf declared in the classroom
String
C#
string str1 = "Hello world!";
string str2 = "lo";
int pos = str1.IndexOf(str2);
// pos = 3
C#
string str1 = "Hello world!";
string str2 = "LO";
int pos = str1.IndexOf(str2);
// pos = -1