StringUtilsExtension extension

Utility String extensions

on

Methods

count(String pattern) int
Returns the number of occurrences of pattern in the string.
lastChar() String?
Returns the last character of the string, or null if empty.
lcfirst() String
Changes the first character of the string to lower-case.
splitAndTrim(String pattern, {bool removeEmpty = true, bool respectQuotes = false}) List<String>?
Splits a string into a List of trimmed Strings, potentially avoiding splitting in the middle of a quoted text. if respectQuotes is true - then the string is not split between quotes. however, this functionality is (currently?) limited:
stripTabs() String
Trim whitespaces at the edges, and remove all tabs from the content of the string.
ucfirst() String
Capitalizes the first character of the string.