isByteLength function

bool isByteLength (
  1. String str,
  2. int min,
  3. [int max]
)

check if the string's length (in bytes) falls in a range.

Implementation

bool isByteLength(String str, int min, [int max]) {
  return str.length >= min && (max == null || str.length <= max);
}