String
Exclusive validations for strings
Length Validator
Ensures that the length of a string is within the specified range.
Example:
Example error: 'Name' must be between 1 and 50 characters but currently has 51.
String format args:
Name
: Name of the type being validatedValue
: Current value of the propertyMinLength
: Minimum lengthMaxLength
: Maximum lengthActualLength
: Actual number of characters
Exact Length Validator
Ensures that the length of a string is exactly the specified length.
Example:
Example error: 'Code' must contain exactly 10 characters but currently has 11.
String format args:
Name
: Name of the type being validatedValue
: Current value of the propertyExactLength
: Number of characters requiredActualLength
: Actual number of characters
MinLength Validator
Ensures that the length of a string is higher or equal to the specified value.
Example:
Example error: 'Name' must be at least 10 characters but currently has 4.
String format args:
Name
: Name of the type being validatedValue
: Current value of the propertyMinLength
: Minimum lengthActualLength
: Actual number of characters
MaxLength Validator
Ensures that the length of a string is less than or equal to the specified value.
Example:
Example error: 'Name' must be 50 characters or less but currently has 51.
String format args:
Name
: Name of the type being validatedValue
: Current value of the propertyMaxLength
: Maximum lengthActualLength
: Actual number of characters
Regular Expression Validator
Ensures that the string meets the specified regular expression.
Example:
Example error: 'Name' is not in the correct format. Expected format '[0-9]{1}'.
String format args:
Name
: Name of the type being validatedValue
: Current value of the propertyComparisonValue: The regular expression specified
Last updated