StringExtensionBase extension

on

Methods

capitalize() String

Available on String, provided by the StringExtensionBase extension

capitalizeAndLowercase() String

Available on String, provided by the StringExtensionBase extension

Capitalize the first character of the string and lowercase the others (using toUpperCase() and toLowerCase() respectively).
capitalizeAndLowercaseAnyWord() String

Available on String, provided by the StringExtensionBase extension

Capitalize the first character of any word in the string string and lowercase the others (using toUpperCase() and toLowerCase() respectively). The method also execute am implicit trim() on the atring
capitalizeRestUnchanged() String

Available on String, provided by the StringExtensionBase extension

Capitalize the first character of the string and leaves the rest as is. In a future release will be called only capitalize
cut(int newLength) String

Available on String, provided by the StringExtensionBase extension

Cuts the String to the required length starting from the beginning
cutAndAlign(int newLength, {String? paddingChar, bool? leftAlign}) String

Available on String, provided by the StringExtensionBase extension

Cuts the String and, if lesser then required, aligns it padding the exceeding chars to the right or to the left with the character selected.
getDartIdentifier(int startPosition) String

Available on String, provided by the StringExtensionBase extension

Extracts the identifier (if present) from a source string in a certain position.
isDartIdentifier(int startPosition) bool

Available on String, provided by the StringExtensionBase extension

Verifies if the content of one source string in a certain position is a Dart identifier.
onlyContainsAlpha() bool

Available on String, provided by the StringExtensionBase extension

A convenient way for checking if there are only alpha chars (a-zA-Z).
onlyContainsDigits() bool

Available on String, provided by the StringExtensionBase extension

A convenient way for checking if there are only digits.
preserveOnlyChars(String validChars, {String? replacementChar}) String

Available on String, provided by the StringExtensionBase extension

Returns a String that is made of some required chars only. Optionally the removed characters can be substituted with a replacement char
splitInLines(int lineLength, {String? separator, int? firstLineDecrease}) List<String>

Available on String, provided by the StringExtensionBase extension

Divides a String in lines of the length required. The default separator is blank, but it can be set a different char It is possible to set a different length for the first line.
startsAndEndsWith(String delimiter) bool

Available on String, provided by the StringExtensionBase extension

Returns true if this string starts and ends with the same given string If whitespaces can be present is better to execute first a trim() call.
trimDelimiters(String delimiter) String

Available on String, provided by the StringExtensionBase extension

Removes the given delimiters (if present) from the string
trimLeftChar(String c) String

Available on String, provided by the StringExtensionBase extension

trimRightChar(String c) String

Available on String, provided by the StringExtensionBase extension

trimStringDelimiters() String

Available on String, provided by the StringExtensionBase extension

Removes String delimiters if present (only the outer ones);
uncapitalizeRestUnchanged() String

Available on String, provided by the StringExtensionBase extension

Uncapitalize the first character of the string and leaves the rest as is. In a future release will be called only uncapitalize