AppKit.TextKit.Formatter.LanguageFormatter.FindEndOfLine C# (CSharp) Method

FindEndOfLine() public method

Finds the start of end for the given location in the text as defined by the NewLine, LineSeparator and ParagraphSeparator characters.
public FindEndOfLine ( string text, NSRange position ) : NSRange
text string The text to find the end of the line in.
position NSRange The current location of the cursor in the text and possible selection.
return NSRange
		public virtual NSRange FindEndOfLine(string text, NSRange position) {
			NSRange results = position;
			var found = false;

			// Find ending line boundry
			found = false;
			while((int)(results.Location + results.Length) < text.Length && !found) {
				var c = text [(int)(results.Location + results.Length)];
				found = (c == Newline || c == LineSeparator || c == ParagraphSeparator);
				if (!found) results.Length += 1;
			};

			return results;
		}