predicates/string_predicates
library
Functions
-
contains(String str, String seed)
→ bool
-
Returns
true if str contains seed.
-
containsIgnoreCase(String str, String seed)
→ bool
-
Returns
true if str contains seed, ignoring case.
-
equals(String? str, String comparison)
→ bool
-
Returns
true if str equals comparison.
-
isAlpha(String str)
→ bool
-
Returns
true if str contains only ASCII alphabetic characters (a–z, A–Z).
-
isAlphaNumeric(String str)
→ bool
-
Returns
true if str contains only ASCII alphanumeric characters (a–z, A–Z, 0–9).
-
isAscii(String str)
→ bool
-
Returns
true if str contains only printable ASCII characters (U+0000–U+007F).
-
isBase64(String str)
→ bool
-
Returns
true if str is a valid Base64-encoded string.
-
isByteLength(String str, int min, [int? max])
→ bool
-
Returns
true if str byte-length is within `min`, `max`.
-
isEmail(String str)
→ bool
-
Returns
true if str matches the RFC 5322 email format heuristic.
-
isFloat(String str)
→ bool
-
Returns
true if str represents a floating-point number.
-
isFullWidth(String str)
→ bool
-
Returns
true if str contains full-width Unicode characters.
-
isHalfWidth(String str)
→ bool
-
Returns
true if str contains half-width Unicode characters.
-
isHexadecimal(String str)
→ bool
-
Returns
true if str is a valid hexadecimal string.
-
isHexColor(String str)
→ bool
-
Returns
true if str is a valid hex color (e.g. #FFF or #FFFFFF).
-
isInt(String str)
→ bool
-
Returns
true if str represents an integer.
-
isJson(String str)
→ bool
-
Returns
true if str is valid JSON.
-
isLength(String str, int min, [int? max])
→ bool
-
Returns
true if the display-length of str is within `min`, `max`,
counting surrogate pairs as single characters.
-
isLowerCase(String str)
→ bool
-
Returns
true if str is entirely lowercase (or has no cased characters).
-
isMultiByte(String str)
→ bool
-
Returns
true if str contains multi-byte (non-ASCII) characters.
-
isNull(String? str)
→ bool
-
Returns
true if str is null or empty.
-
isNullOrEmpty(String? str)
→ bool
-
Returns
true if str is null or empty.
-
isNumeric(String str)
→ bool
-
Returns
true if str contains only numeric digits (optionally negative).
-
isSurrogatePair(String str)
→ bool
-
Returns
true if str contains surrogate pairs.
-
isUpperCase(String str)
→ bool
-
Returns
true if str is entirely uppercase (or has no cased characters).
-
isVariableWidth(String str)
→ bool
-
Returns
true if str contains both full-width and half-width characters.
-
matches(String str, String pattern)
→ bool
-
Returns
true if str matches the regex pattern.