StringExt extension

String Extensions

on

Properties

firstLetter String

Available on String, provided by the StringExt extension

Get First Letter
no setter

Methods

capitalizeFirst() String

Available on String, provided by the StringExt extension

Capitalizes only the first letter of the string. Example: "hello world""Hello world"
hasMatch(String pattern) bool

Available on String, provided by the StringExt extension

Checks whether the string contains a match for the given pattern.
isBool({bool caseSensitive = true}) bool

Available on String, provided by the StringExt extension

Checks if the string is a valid boolean representation.
isDouble() bool

Available on String, provided by the StringExt extension

Checks if the string is a valid double.
isEmail() bool

Available on String, provided by the StringExt extension

Checks if the string is a valid email.
isInt() bool

Available on String, provided by the StringExt extension

Checks if the string is a valid integer.
isNum() bool

Available on String, provided by the StringExt extension

Checks if the string is a valid number.
isNumeric() bool

Available on String, provided by the StringExt extension

Returns true if the string contains only numeric characters.
isPhoneNumber() bool

Available on String, provided by the StringExt extension

Checks if the string is a valid phone number. (Supports international formats)
mask(int visibleLength, {String maskChar = '*'}) String

Available on String, provided by the StringExt extension

Masks part of a string (e.g., credit card or password). Example: "12345678".mask(4)"****5678"
removeAllWhitespace() String

Available on String, provided by the StringExt extension

Removes all whitespace from the string.
reverse() String

Available on String, provided by the StringExt extension

Reverses the string. Example: "hello""olleh"
toBool({bool caseSensitive = true}) bool

Available on String, provided by the StringExt extension

Converts the string to a boolean.
toDouble() double

Available on String, provided by the StringExt extension

Converts the string to a double.
toInt() int

Available on String, provided by the StringExt extension

Converts the string to an integer.
toNum() num

Available on String, provided by the StringExt extension

Converts the string to a number.
toTitleCase() String

Available on String, provided by the StringExt extension

Capitalizes each word in the string. Example: "hello world""Hello World"