StringExt extension
String Extensions
- on
Properties
- firstLetter → String
-
Available on String, provided by the StringExt extension
Get First Letterno 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 - Checks whether the string contains a match for the given pattern.
-
isBool(
{bool caseSensitive = true}) → bool - Checks if the string is a valid boolean representation.
-
isDouble(
) → bool - Checks if the string is a valid double.
-
isEmail(
) → bool - Checks if the string is a valid email.
-
isInt(
) → bool - Checks if the string is a valid integer.
-
isNum(
) → bool - Checks if the string is a valid number.
-
isNumeric(
) → bool - Returns true if the string contains only numeric characters.
-
isPhoneNumber(
) → bool - 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 - 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 - Converts the string to a boolean.
-
toDouble(
) → double - Converts the string to a double.
-
toInt(
) → int - Converts the string to an integer.
-
toNum(
) → num - 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"