GetTextBetween() public method

public GetTextBetween ( Mono.TextEditor.DocumentLocation start, Mono.TextEditor.DocumentLocation end ) : string
start Mono.TextEditor.DocumentLocation
end Mono.TextEditor.DocumentLocation
return string
Ejemplo n.º 1
0
		string RemoveIndent (string text, string indent)
		{
			var doc = new TextDocument ();
			doc.Text = text;
			var result = new StringBuilder ();
			foreach (DocumentLine line in doc.Lines) {
				string curLineIndent = line.GetIndentation (doc);
				int offset = Math.Min (curLineIndent.Length, indent.Length);
				result.Append (doc.GetTextBetween (line.Offset + offset, line.EndOffsetIncludingDelimiter));
			}
			return result.ToString ();
		}
Ejemplo n.º 2
0
 public string GetText(int startPosition, int endPosition)
 {
     return(document.GetTextBetween(startPosition, endPosition));
 }