Water 5-Common Data Types-String, Bytes, and CharClass of single characters
Contract| Parameter key | Default value | Type | | one_char_string | req with ekind of code | type.<one_of string.one_char number.integer/> | | Water Contract<class char
one_char_string=req=<type.one_of string.one_char number.integer/>
/> | |
See also: string
Methods: less, more_or_equal, copy, to_uppercase, to_lowercase, remove_entity_name, make, add_entity_name, less_or_equal, to_regex, to_path, more, from, entity_names, is_entity_name
The way to use a literal character is <char "a"/>
The Unicode numeric value may be used for non-printing characters.
Example: <char 65/>
for uppercase A. The following is equivalent:
char.A <char 10/>
char.newline
There are several special characters defined in the char class:
a wob
| Parameter key | Default value | Type |
| newline | <char 10/> | char |
control-j or ASCII code 10 a wob
| Parameter key | Default value | Type |
| formfeed | <char 12/> | char |
control-l or \f a wob
| Parameter key | Default value | Type |
| carriage_return | <char 13/> | char |
control-m or ASCII code 13 a wob
| Parameter key | Default value | Type |
| tab | <char 9/> | char |
control-i ASCII code 9 a wob
| Parameter key | Default value | Type |
| vertical_tab | <char 11/> | char |
control-k, ASCII code 11, \v a wob
| Parameter key | Default value | Type |
| alert | <char 7/> | char |
control-g or \a a wob
| Parameter key | Default value | Type |
| backspace | <char 8/> | char |
control-h or \b a wob
| Parameter key | Default value | Type |
| backslash | <char 92/> | char |
use double-backslash to escape a wob
| Parameter key | Default value | Type |
| slash | <char "/"/> | char |
regular forward-slash or ASCII code 47 a wob
| Parameter key | Default value | Type |
| comma | <char ","/> | char |
comma or ASCII code 44 a wob
| Parameter key | Default value | Type |
| dot | <char "."/> | char |
dot, period, or ASCII code 46 a wob
| Parameter key | Default value | Type |
| space | <char " "/> | char |
space or ASCII code 32 a wob
| Parameter key | Default value | Type |
| single_quote | <char "'"/> | char |
apostrophe, single quote or ASCII code 39 a wob
| Parameter key | Default value | Type |
| double_quote | <char '"'/> | char |
double quote or ASCII code 34
To convert a char to an integer, use from :
integer.<from <char "A"/> />
65
See the documentation on string for more escaped characters.
Note that unlike the Java type char, the Water char is
a real object.
© Copyright 2007 Clear Methods, Inc.