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
Returnstrue
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 returnTrue
if contains otherwise returnFalse
-
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 aninteger
. -
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 anNumber
. -
lastChars(
int n) → String -
Available on String?, provided by the NullStringExtension extension
Returns the lastn
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 givencharacters
, with an optional case sensitivity. -
take(
int numberOfCharacters) → String -
Available on String?, provided by the NullStringExtension extension
Returns only the firstnumberOfCharacters
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 aninteger
. -
toNum(
) → num? -
Available on String?, provided by the NullStringExtension extension
Converts the String to anNumber
. -
toWordsFirstCharacters(
{int? numberOfCharacters, String splitBy = '\\s+'}) → String -
Available on String?, provided by the NullStringExtension extension
Returns the firstnumberOfCharacters
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.