string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
void OutputLine(ReadOnlySpan<char> span)
for (int i = 0; i < span.Length; i++)
IterateAllPosibleStrings(3, alphabet, OutputLine);
Console.WriteLine("Hello World!");
public delegate void Action_ReadOnlySpan<T>(ReadOnlySpan<T> readOnlySpan);
public static void IterateAllPosibleStrings(int length, ReadOnlySpan<char> possibleElements, Action_ReadOnlySpan<char> action)
Span<int> digits = stackalloc int[length];
Span<char> span = stackalloc char[length];
for (int i = 0; i < span.Length; i++)
span[i] = possibleElements[0];
if (digits[digit] >= possibleElements.Length)
span[digit] = possibleElements[digits[digit]];
span[digit] = possibleElements[digits[digit]];