Check if the string's length (in bytes) falls in a range.
bool isByteLength(int min, [int? max]) => length >= min && (max == null || length <= max);