StringExtension extension

on

Properties

date DateTime?

Available on String?, provided by the StringExtension extension

Returns DateTime if string is a date string like "2025-01-01 12:00:00"
no setter
dateOnly DateTime?

Available on String?, provided by the StringExtension extension

Returns DateTime if string is a date string like "2025-01-01"
no setter
ipv4Tov6 String?

Available on String?, provided by the StringExtension extension

Convert an IPv4 address to an IPv6 address,
no setter
ipv6Tov4 String?

Available on String?, provided by the StringExtension extension

Convert an IPv6 address to an IPv4 address,
no setter
isChineseFullName bool

Available on String?, provided by the StringExtension extension

Returns true if name is a valid Chinese full name.
no setter
isChineseIdNumber bool

Available on String?, provided by the StringExtension extension

Returns true if id is a valid Chinese resident ID number.
no setter
isCreditCard bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid credit card number
no setter
isDate bool

Available on String?, provided by the StringExtension extension

Returns true if string is a date
no setter
isDEANumberOfUS bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid US Drug Enforcement Agency
no setter
isEmail bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid email address
no setter
isEmpty bool

Available on String?, provided by the StringExtension extension

Returns true if string is null or empty
no setter
isIPAddress bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid IPv4 or IPv6 address
no setter
isIPv4 bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid IPv4 address
no setter
isIPv6 bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid IPv6 address
no setter
isJson bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid JSON string
no setter
isNotEmpty bool

Available on String?, provided by the StringExtension extension

Returns true if string is not empty
no setter
isNumeric bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid number
no setter
isPhoneNumberOfUS bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid US Phone Number
no setter
isQuery bool

Available on String?, provided by the StringExtension extension

Validates URL query string (handles ? & # fragments, allows empty values)
no setter
isSSNofUS bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid US Society Security Number
no setter
isStrongPassword bool

Available on String?, provided by the StringExtension extension

Returns true if string match strong password requirements
no setter
isTime bool

Available on String?, provided by the StringExtension extension

Returns true if string is a time
no setter
isUrl bool

Available on String?, provided by the StringExtension extension

Returns true if string is a valid url
no setter
time Time?

Available on String?, provided by the StringExtension extension

Returns Time if string is a time string like "12:00:00"
no setter
timeOnly Time?

Available on String?, provided by the StringExtension extension

Returns Time if string is a time string like "12:00:00"
no setter

Methods

bytes() List<int>

Available on String?, provided by the StringExtension extension

Returns a list of the UTF-16 code units of the string.
bytesChunks(int chunkSize) List<List<int>>

Available on String?, provided by the StringExtension extension

Splits the string's UTF-16 code units (bytes) into a list of chunks.
bytesCount() int

Available on String?, provided by the StringExtension extension

Calculates the byte count of a string, treating non-ASCII characters as 2 bytes.
capitalize() String

Available on String?, provided by the StringExtension extension

Returns string with capitalized first letter
chunks(int chunkSize) List<String>

Available on String?, provided by the StringExtension extension

Splits the string into a list of chunks of a specified size.
isValidFileExtension([List<String>? allowed]) bool

Available on String?, provided by the StringExtension extension

Returns true if string is a file
json() → dynamic

Available on String?, provided by the StringExtension extension

Returns JSON object if string is a valid JSON string
numeric() double?

Available on String?, provided by the StringExtension extension

Returns double 0.564 from string percentage like "56.4%" Parse source as a double literal and return its value.
toCamelCase() String

Available on String?, provided by the StringExtension extension

Converts a string from snake_case or kebab-case to camelCase.
toSnakeCase({String separator = '_'}) String

Available on String?, provided by the StringExtension extension

Converts a string from camelCase to snake_case.