StringExt extension

String extensions to add useful utility methods.

on

Properties

mock String

Available on String, provided by the StringExt extension

Mocks a string that needs to be translated.
no setter

Methods

capitalize() String

Available on String, provided by the StringExt extension

Capitalizes each word in the string.
capitalizeFirst() String

Available on String, provided by the StringExt extension

Capitalizes only the first letter of the string.
hasMatch(String pattern) bool

Available on String, provided by the StringExt extension

Checks whether the string matches a given regex pattern.
isBool({bool caseSensitive = true}) bool

Available on String, provided by the StringExt extension

Checks if the string represents a boolean value.
isDouble() bool

Available on String, provided by the StringExt extension

Checks if the string represents a double value.
isInt() bool

Available on String, provided by the StringExt extension

Checks if the string represents an integer value.
isNum() bool

Available on String, provided by the StringExt extension

Checks if the string represents a numeric value.
removeAllWhitespace() String

Available on String, provided by the StringExt extension

Removes all whitespace from the string.
toBool({bool caseSensitive = true}) bool

Available on String, provided by the StringExt extension

Converts the string into a boolean value.
toDouble() double

Available on String, provided by the StringExt extension

Converts the string into a double.
toInt() int

Available on String, provided by the StringExt extension

Converts the string into an integer.
toNum() num

Available on String, provided by the StringExt extension

Converts the string into a numeric value.