using System.Collections.Generic;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
using System.Text.RegularExpressions;
public static class Program
public enum A { a = 0, b = 1, c = 2 }
public class AdjustSelector<T>
internal AdjustSelector() { }
public Func<T, int, bool> ByPosition(int position) =>
(_, pos) => position == pos;
public Func<T, int, bool> ByProp(Func<T, bool> predicate) =>
(obj, _) => predicate(obj);
public static IEnumerable<T> Adjust<T>(this IEnumerable<T> @this, Func<T, int, bool> shouldReplace, T replacement) =>
@this.Select((obj, pos) =>
public static void Main()
Console.WriteLine("App started.");
Console.WriteLine("App finished.");
public static void Test1()
var arrayOfStuff = new[] { "a", "b", "c", "d" };
var array2 = arrayOfStuff.Adjust((x, i) => i == 2, "z");
Console.WriteLine(string.Join(", ", array2));
public static void Test2(A value)
public static void Test3()
Console.WriteLine(((int?) a));