Search a character in a string
using System;
class MainClass {
public static void Main() {
string str = "abcdefghijk";
int idx;
Console.WriteLine("str: " + str);
idx = str.IndexOf('h');
Console.WriteLine("Index of first 'h': " + idx);
}
}
Output str: abcdefghijk
Index of first 'h': 7
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
|