public static int Indentation(this string text) { int indent = 0; for (int i = 0; i < text.Length; ++i) { if (text [i] == ' ') ++indent; else break; } return indent; }