StringBasics extension
Utility extension methods for the native String class.
- on
Properties
- isBlank → bool
-
Available on String, provided by the StringBasics extension
Returnstrueifthisis empty or consists solely of whitespace characters as defined by String.trim.no setter - isNotBlank → bool
-
Available on String, provided by the StringBasics extension
Returnstrueifthisis not empty and does not consist solely of whitespace characters as defined by String.trim.no setter
Methods
-
capitalize(
) → String -
Available on String, provided by the StringBasics extension
Returns a string with the first character in upper case. -
compareToIgnoringCase(
String other) → int -
Available on String, provided by the StringBasics extension
Returns a value according to the contract for Comparator indicating the ordering betweenthisandother, ignoring letter case. -
insert(
String other, int index) → String -
Available on String, provided by the StringBasics extension
Returns a copy ofthiswithotherinserted starting atindex. -
partition(
Pattern pattern) → List< String> -
Available on String, provided by the StringBasics extension
Divides string into everything beforepattern,pattern, and everything afterpattern. -
prepend(
String other) → String -
Available on String, provided by the StringBasics extension
Returns the concatenation ofotherandthis. -
reverse(
) → String -
Available on String, provided by the StringBasics extension
Returnsthiswith characters in reverse order. -
slice(
{int? start, int? end, int step = 1}) → String -
Available on String, provided by the StringBasics extension
Returns a new string containing the characters ofthisfromstartinclusive toendexclusive, skipping bystep. -
truncate(
int length, {String substitution = '', bool trimTrailingWhitespace = true, bool includeSubstitutionInLength = false}) → String -
Available on String, provided by the StringBasics extension
Returns a truncated version of the string. -
withoutPrefix(
Pattern prefix) → String -
Available on String, provided by the StringBasics extension
Returns a copy ofthiswithprefixremoved if it is present. -
withoutSuffix(
Pattern suffix) → String -
Available on String, provided by the StringBasics extension
Returns a copy ofthiswithsuffixremoved if it is present.