public static StringBuilder MoveCursorToLineStart(this StringBuilder sb) { int cursorLine = sb.FindIndexLine(sb.FindCursorIndex()); int index = sb.FindLineIndex(cursorLine); sb.RemoveCursor().AddCursorIndex(index); return(sb); }
public static int FindLine(this StringBuilder sb, string s) { return(sb.FindIndexLine(sb.ToString().IndexOf(s))); }
private static int FindCursorLine(this StringBuilder sb) { return(sb.FindIndexLine(sb.FindCursorIndex())); }