StringExtensions extension

on

Properties

containsEmoji bool

Available on String, provided by the StringExtensions extension

Checks if the string contains any type of emoji.
no setter
doesNotContainEmoji bool

Available on String, provided by the StringExtensions extension

no setter
isBinary bool

Available on String, provided by the StringExtensions extension

Checks if the string can be parsed as a binary number (only contains 1's and 0's).
no setter
isBlank bool

Available on String, provided by the StringExtensions extension

no setter
isDecimal bool

Available on String, provided by the StringExtensions extension

Checks if the string can be parsed as a decimal number.
no setter
isDouble bool

Available on String, provided by the StringExtensions extension

Checks if the string can be parsed into a double.
no setter
isHexadecimal bool

Available on String, provided by the StringExtensions extension

Checks if the string can be parsed as a hexadecimal number, which only contains characters 0-9 and A-F or a-f.
no setter
isOctal bool

Available on String, provided by the StringExtensions extension

Checks if the string can be parsed as an octal number, which only contains characters 0-7.
no setter
toggledCase String

Available on String, provided by the StringExtensions extension

Toggles the case of each character.
no setter
wordCount int

Available on String, provided by the StringExtensions extension

Returns the number of words in the string.
no setter
words List<String>

Available on String, provided by the StringExtensions extension

no setter

Methods

capitalizeEachWord() String

Available on String, provided by the StringExtensions extension

countOccurrences(String match, {bool caseSensitive = true}) int

Available on String, provided by the StringExtensions extension

Counts occurrences of a character in a string.
equalsToIgnoreCase(String matcher) bool

Available on String, provided by the StringExtensions extension

getFirstLetter() String

Available on String, provided by the StringExtensions extension

getLastLetter() String

Available on String, provided by the StringExtensions extension

initials() String

Available on String, provided by the StringExtensions extension

Returns the initials of the string.
isAlphabetic() bool

Available on String, provided by the StringExtensions extension

Checks if the string contains only alphabets.
isAlphanumeric() bool

Available on String, provided by the StringExtensions extension

Checks if the string contains only alphanumeric characters.
isNumeric() bool

Available on String, provided by the StringExtensions extension

isPalindrome() bool

Available on String, provided by the StringExtensions extension

isremoveAllWhitespace() String

Available on String, provided by the StringExtensions extension

isStrongPassword() bool

Available on String, provided by the StringExtensions extension

A strong password must:
reverse() String

Available on String, provided by the StringExtensions extension

Reverses the string.
toBoolOrNull() bool?

Available on String, provided by the StringExtensions extension

toCamelCase() String

Available on String, provided by the StringExtensions extension

toDateTimeOrNull() DateTime?

Available on String, provided by the StringExtensions extension

Tries to parse the string into a DateTime, returning null if parsing fails.
toDouble() double?

Available on String, provided by the StringExtensions extension

Checks if the string is a proper name. A proper name must:
toDoubleOrNull() double?

Available on String, provided by the StringExtensions extension

Tries to parse the string into a double, returning null if parsing fails.
toInt() int?

Available on String, provided by the StringExtensions extension

Converts the string to an int or returns null if conversion fails.
toIntOrNull({int? radix}) int?

Available on String, provided by the StringExtensions extension

Parses this to an int or returns null. Radix can be between 2 and 36.
toSnakeCase() String

Available on String, provided by the StringExtensions extension

unwrap(String prefix, [String? suffix]) String

Available on String, provided by the StringExtensions extension

Removes prefix and suffix from the string if they exist. If suffix is not provided, prefix is used as suffix.
wrap(String prefix, [String? suffix]) String

Available on String, provided by the StringExtensions extension

Wraps the string with prefix and suffix. If suffix is not provided, prefix is used as suffix.