public static bool StartsWith(this string s, string value, int startIndex, StringComparison comparisonType) { if (s.Length < startIndex + value.Length) return false; return s.IndexOf(value, startIndex, value.Length, comparisonType) == startIndex; }