public PreceedingCharacterIsWhitespaceOrTerminator ( 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 PreceedingCharacterIsWhitespaceOrTerminator(string text, NSRange position) {
var found = false;
// At start of line?
if (position.Location == 0) {
// 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;
}