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

TrailingCharacterIsWhitespaceOrTerminator() public method

Tests to see if the trailing character is whitespace or terminator.
Returns true if at end of line.
public TrailingCharacterIsWhitespaceOrTerminator ( string text, NSRange position ) : bool
text string The text to test.
position NSRange The current cursor position inside the text.
return bool
		public virtual bool TrailingCharacterIsWhitespaceOrTerminator(string text, NSRange position) {
			var found = false;

			// At end of line?
			if (position.Location >= text.Length-1) {
				// Yes, always true
				return true;
			}

			// Found?
			var c = text [(int)(position.Location + 1)];
			found = (c == ' ' | c == Newline || c == LineSeparator || c == ParagraphSeparator);

			// Return result
			return found;
		}