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.
PositionParameterData typeDefault valueDescription
1Minimum lengthInteger0The minimum number of (Unicode) characters in the string. This parameter accepts the special value default, which uses its default value.
2Maximum lengthIntegerinfiniteThe maximum number of (Unicode) characters in the string. This parameter accepts the special value default, which uses its default value.

Examples:

  • String

    Matches 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.