public static List<StringWithIndex> SplitWithoutModificationRegex(this StringWithIndex text, string regexStr)
        {
            var parts = new List<StringWithIndex>();

            var regex = new Regex(regexStr);
            var area = text.Text;

            var prevIndex = 0;
            var m = regex.Match(area);

            while (m.Success)
            {
                var index = m.Index;

                parts.Add(text.Substring(prevIndex, index - prevIndex));

                prevIndex = index;
                m = regex.Match(area, index + 1);
            }

            // Add last part
            parts.Add(text.Substring(prevIndex, area.Length - prevIndex));

            return parts;
        }
        public static List<StringWithIndex> SplitAfterFirstLine(this StringWithIndex text)
        {
            var area = text.Text;
            var lineBreakIndex = area.IndexOf("\r\n");

            return new List<StringWithIndex>() {
                text.Substring(0, lineBreakIndex),
                text.Substring(lineBreakIndex+2)
            };
        }
        public static StringWithIndex TrimStart(this StringWithIndex text, params char[] chars)
        {
            var trimmed = text.Text.TrimStart(chars);
            var lengthDiff = text.Length - trimmed.Length;

            return text.Substring(lengthDiff, text.Length - lengthDiff);
        }
 public static StringWithIndex ReplaceEnd(this StringWithIndex text, string match, string replacement)
 {
     if (text.Text.EndsWith(match))
     {
         return text.Substring(0, text.Text.Length - match.Length);
     }
     else
     {
         return text;
     }
 }
 public static StringWithIndex ReplaceStart(this StringWithIndex text, string match, string replacement)
 {
     if (text.Text.StartsWith(match))
     {
         return text.Substring(match.Length);
     }
     else
     {
         return text;
     }
 }
        public static StringWithIndex TrimStart(this StringWithIndex text, params string[] starts)
        {
            var trimmed = text.Text;

            foreach (var s in starts.OrderByDescending(s => s.Length))
            {
                if (trimmed.StartsWith(s))
                {
                    trimmed = trimmed.ReplaceStart(s, "");
                    break;
                }
            }

            var lengthDiff = text.Length - trimmed.Length;

            return text.Substring(lengthDiff, text.Length - lengthDiff);
        }