private static string GenerateShortcutAlias(string baseAlias, List<string> excluded, bool ignoreCase) { string shortcutVal = ""; foreach (char c in baseAlias.Substring(0, baseAlias.Length - 1)) { shortcutVal += c; if (excluded.Contains(shortcutVal, new CaseAwareStringComparer(ignoreCase)) == false) { return shortcutVal; } } return null; }