The String data type
The data type of strings is String. By default, String matches strings of
any length. You can use parameters to restrict which values String matches.
Parameters
The full signature for String is:
String[<MIN LENGTH>, <MAX LENGTH>]These parameters are optional. They must be listed in order; if you need to specify a later parameter, you must also specify values for any prior ones.
| Position | Parameter | Data type | Default value | Description |
|---|---|---|---|---|
| 1 | Minimum length | Integer | 0 | The minimum number of (Unicode) characters in the string.
This parameter accepts the special value default, which uses its default
value. |
| 2 | Maximum length | Integer | infinite | The maximum number of (Unicode) characters in the string.
This parameter accepts the special value default, which uses its default
value. |
Examples:
-
StringMatches a string of any length.
-
String[6]Matches a string with at least six characters.
-
String[6,8]Matches a string with at least six and at most eight characters.