// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Program { public static void Test(string s) { Console.WriteLine(s); Console.WriteLine("IndexOf A = " + s.IndexOf('A')); Console.WriteLine("IndexOf B = " + s.IndexOf('B')); Console.WriteLine("IndexOf C = " + s.IndexOf('C')); Console.WriteLine("IndexOfAny ABC = " + s.IndexOfAny(new char[] { 'A', 'B', 'C' })); } public static void Main(string[] args) { Test("ABC"); Test("AX"); Test("XB"); Test("X"); Test("BA"); } } }