NullStringExtension extension

on

Properties

isEmptyOrNull → bool

Available on String?, provided by the NullStringExtension extension

Checks if the given String is null or empty.
no setter
isNotEmptyOrNull → bool

Available on String?, provided by the NullStringExtension extension

Checks if the given String is not null or empty.
no setter
length → int

Available on String?, provided by the NullStringExtension extension

Returns the length of the String after trimming leading and trailing whitespace.
no setter

Methods

capitalizeEachWordFirstCharacter() → String

Available on String?, provided by the NullStringExtension extension

Capitalizes the first letter of each word in the string.
capitalizeFirstCharacter() → String

Available on String?, provided by the NullStringExtension extension

Capitalizes the first letter of the string.
countWords() → int

Available on String?, provided by the NullStringExtension extension

Counts the number of words in the string.
defaultBlank() → String

Available on String?, provided by the NullStringExtension extension

Returns an empty String if null.
isAlphabetOnly() → bool

Available on String?, provided by the NullStringExtension extension

Returns true if string contains only alphabet symbols
isContainsAlphabetLetter() → bool

Available on String?, provided by the NullStringExtension extension

Checks whether the given string contains a single letter or not and return True if contains otherwise return False
isDateTime() → bool

Available on String?, provided by the NullStringExtension extension

Checks if the String value is convertible to DateTime.
isDouble() → bool

Available on String?, provided by the NullStringExtension extension

Checks if the String value is convertible to a double.
isInt() → bool

Available on String?, provided by the NullStringExtension extension

Checks if the String is an integer.
isJsonDecodable() → bool

Available on String?, provided by the NullStringExtension extension

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

Available on String?, provided by the NullStringExtension extension

Checks if the String is an Number.
lastChars(int n) → String

Available on String?, provided by the NullStringExtension extension

Returns the last n characters of the string.
removeAllWhiteSpace() → String

Available on String?, provided by the NullStringExtension extension

Removes all white spaces from the string.
reversed() → String

Available on String?, provided by the NullStringExtension extension

Returns the reversed string.
startsWithCharacters(String characters, {bool matchCase = false}) → bool

Available on String?, provided by the NullStringExtension extension

Checks if the String starts with the given characters, with an optional case sensitivity.
take(int numberOfCharacters) → String

Available on String?, provided by the NullStringExtension extension

Returns only the first numberOfCharacters characters of the string.
toDateTime() → DateTime?

Available on String?, provided by the NullStringExtension extension

Converts the String value to a DateTime object if it's valid.
toDouble() → double?

Available on String?, provided by the NullStringExtension extension

Converts the String value to a double if it's valid.
toInt() → int?

Available on String?, provided by the NullStringExtension extension

Converts the String to an integer.
toNum() → num?

Available on String?, provided by the NullStringExtension extension

Converts the String to an Number.
toWordsFirstCharacters({int? numberOfCharacters, String splitBy = '\\s+'}) → String

Available on String?, provided by the NullStringExtension extension

Returns the first numberOfCharacters from the first letter of each word in the string.
validate([String value = '']) → String

Available on String?, provided by the NullStringExtension extension

Returns the String if it's not null, otherwise returns the provided default value.
validateURL() → bool

Available on String?, provided by the NullStringExtension extension

Validates whether the String is a valid URL.