verifyLength method

bool verifyLength(
  1. int min,
  2. int max
)

验证字符串长度是否在范围内

Implementation

bool verifyLength(int min, int max) {
  if (min > max) {
    max = min;
  }
  var len = 0;
  if (this.isEmptyString) {
    return min == len;
  }
  len = this!.trim().count;
  return len >= min && len <= max;
}