using System;
using System.Collections.Generic;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
const string s1 = "c# programming";
const string s2 = "java programming";
int i = s1.IndexOfAny(new char[] {'#', 'm'});
Console.WriteLine("index = " + i);
Console.WriteLine(s1.Substring(i));
i = s2.IndexOfAny(new char[] { 'y', 'z' });
Console.WriteLine("\nindex = " + i);
if (i >= 0)
Console.WriteLine(s2.Substring(i));
else
Console.WriteLine("not found");
}
}
}
/*
run:
index = 1
# programming
index = -1
not found
*/