private static readonly char[] StartingChars = { '<', '&' };
public static void Main()
var t = IsDangerousString("<TI Cost reduction on All Hella Global lamps (ID 5918)> test", out test);
public static bool IsDangerousString(string s, out int matchIndex)
var n = s.IndexOfAny(StartingChars, i);
if (IsAtoZ(s[n + 1]) || s[n + 1] == '!' || s[n + 1] == '/' || s[n + 1] == '?')
private static bool IsAtoZ(char c)
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');