stringIsOfLength function

IValidator stringIsOfLength(
  1. int size, {
  2. String? message,
})

Validates that the String's length is the same as the provided size

This validator also validates that the value is a String first So there's no need to add the isString validator when using this validator

Implementation

IValidator stringIsOfLength(int size, {String? message}) {
  return stringLength([isEq(size)], message: message ?? 'String length [to be $size]');
}