public static void Main()
string[] valuesToFind = {"77", "34", "12"};
int firstIndex = test.ImaginaryIndexOf(valuesToFind);
Console.WriteLine($"Index of first value returned from string class extension method: {firstIndex}");
public class FoundValue {
public string Value {get;set;}
public int Index {get;set;}
public FoundValue(string value, int index){
public static class CustomStringExtensions {
public static int ImaginaryIndexOf(this string value, params string[] options){
FoundValue first = options.Select(v => new FoundValue(v, value.IndexOf(v))).Where(fv => fv.Index > -1).OrderBy(fv => fv.Index).First();
Console.WriteLine($"The first value found is at {first.Index}: {first.Value}");