StringExtension extension

Extensions for adding additional functionality to the String.

on

Properties

capitalize String
Capitalizes each word in the string, e.g.: hello world becomes Hello World.
no setter
capitalizeFirst String
Capitalizes the first word in the string, e.g.: hello world becomes Hello world.
no setter
isDouble bool
Indicates if the string is a double number
no setter
isEmailAddress bool
Returns true if string contains email
no setter
isInt bool
Indicates if the string is an integer number
no setter
isNum bool
Indicates if the string is a number
no setter
mock String
Mocks a string that needs to be translated or changed
no setter
removeAllWhitespace String
Removes all the whitespace from the string
no setter
toDouble double
Converts the string into an double
no setter
toInt int
Converts the string into an int
no setter
toNum num
Converts the string into a num
no setter

Methods

hasMatch(String pattern) bool
Checks whether this regular expression has a match in the pattern.
isBool({bool caseSensitive = true}) bool
Indicates if the string is a boolean
toBool({bool caseSensitive = true}) bool
Converts the string into a Boolean