Mega Code Archive

 
Categories / C# Book / 02 Essential Types
 

0236 Index of any characters

IndexOfAny returns the index of any characters specified. using System; class Sample { public static void Main() { string s = "rntsoft.com"; Console.WriteLine(s.IndexOfAny(new char[] { 'a', 'v' })); } } The output: 1