CheckCodepointIsWhitespace
Short summary
This methods checks if a unicode character (code point) is a whitespace
:return: TRUE means code point is whitespace,
FALSE means code point is no whitespace
- Return type:
BOOL
Parameters
| Name | Type | Comment | Kind |
|---|---|---|---|
| codepoint | UnicodeCodePoint | character to check if it's whitespace | input |
Code
Declaration
FUNCTION INTERNAL CheckCodepointIsWhitespace : BOOL
VAR_INPUT
(* character to check if it's whitespace *)
codepoint :UnicodeCodePoint;
END_VAR
VAR
END_VAR
Implementation
CASE codePoint OF
16#0009..16#000D, // CHARACTER_TABULATION..CARRIAGE_RETURN
16#0020, // SPACE
16#0085, // NEXT_LINE
16#00A0, // NO_BREAK_SPACE
16#1680, // OGHAM_SPACE_MARK
16#2000..16#200A, // EN_QUAD..HAIR_SPACE
16#2028..16#2029, // LINE_SEPARATOR .. PARAGRAPH_SEPARATOR
16#202F, // NARROW_NO_BREAK_SPACE
16#205F, // MEDIUM_MATHEMATICAL_SPACE,
16#3000: // IDEOGRAPHIC_SPACE
CheckCodepointIsWhitespace := TRUE;
ELSE
CheckCodepointIsWhitespace := FALSE;
END_CASE