StringExtensions extension
String extensions for common operations
- on
Properties
- camelCase → String
-
Available on String, provided by the StringExtensions extension
Convert to camelCaseno setter - capitalize → String
-
Available on String, provided by the StringExtensions extension
Capitalize first letter of stringno setter - extractLetters → String
-
Available on String, provided by the StringExtensions extension
Extract only letters from stringno setter - extractNumbers → String
-
Available on String, provided by the StringExtensions extension
Extract only numbers from stringno setter - isAlphabetic → bool
-
Available on String, provided by the StringExtensions extension
Check if string contains only lettersno setter - isAlphanumeric → bool
-
Available on String, provided by the StringExtensions extension
Check if string contains only letters and numbersno setter - isBlank → bool
-
Available on String, provided by the StringExtensions extension
Check if string is empty or contains only whitespaceno setter - isEmail → bool
-
Available on String, provided by the StringExtensions extension
Check if string is a valid emailno setter - isNotBlank → bool
-
Available on String, provided by the StringExtensions extension
Check if string is not empty and contains non-whitespace charactersno setter - isNumeric → bool
-
Available on String, provided by the StringExtensions extension
Check if string contains only numbersno setter - isPhoneNumber → bool
-
Available on String, provided by the StringExtensions extension
Check if string is a valid phone number (basic check)no setter - isUrl → bool
-
Available on String, provided by the StringExtensions extension
Check if string is a valid URLno setter - kebabCase → String
-
Available on String, provided by the StringExtensions extension
Convert to kebab-caseno setter - pascalCase → String
-
Available on String, provided by the StringExtensions extension
Convert to PascalCaseno setter - removeLetters → String
-
Available on String, provided by the StringExtensions extension
Remove all letters from stringno setter - removeNumbers → String
-
Available on String, provided by the StringExtensions extension
Remove all numbers from stringno setter - removeSpecialCharacters → String
-
Available on String, provided by the StringExtensions extension
Remove all special characters except letters and numbersno setter - removeWhitespace → String
-
Available on String, provided by the StringExtensions extension
Remove all whitespace from stringno setter - reversed → String
-
Available on String, provided by the StringExtensions extension
Reverse the stringno setter - snakeCase → String
-
Available on String, provided by the StringExtensions extension
Convert to snake_caseno setter - titleCase → String
-
Available on String, provided by the StringExtensions extension
Capitalize first letter of each wordno setter
Methods
-
containsAny(
List< String> substrings) → bool -
Available on String, provided by the StringExtensions extension
Check if string contains any of the given substrings -
countOccurrences(
String substring) → int -
Available on String, provided by the StringExtensions extension
Count occurrences of a substring -
endsWithAny(
List< String> suffixes) → bool -
Available on String, provided by the StringExtensions extension
Check if string ends with any of the given suffixes -
padCenter(
int length, {String padding = ' '}) → String -
Available on String, provided by the StringExtensions extension
Center string to specified length with character -
padLeft(
int length, {String padding = ' '}) → String -
Available on String, provided by the StringExtensions extension
Pad string to specified length with character -
padRight(
int length, {String padding = ' '}) → String -
Available on String, provided by the StringExtensions extension
Pad string to specified length with character -
removeFirst(
int n) → String -
Available on String, provided by the StringExtensions extension
Remove first n characters -
removeLast(
int n) → String -
Available on String, provided by the StringExtensions extension
Remove last n characters -
replaceMultiple(
Map< String, String> replacements) → String -
Available on String, provided by the StringExtensions extension
Replace multiple characters at once -
splitAndTrim(
String delimiter) → List< String> -
Available on String, provided by the StringExtensions extension
Split string and trim each part -
startsWithAny(
List< String> prefixes) → bool -
Available on String, provided by the StringExtensions extension
Check if string starts with any of the given prefixes -
takeFirst(
int n) → String -
Available on String, provided by the StringExtensions extension
Get first n characters -
takeLast(
int n) → String -
Available on String, provided by the StringExtensions extension
Get last n characters -
truncate(
int maxLength, {String suffix = '...'}) → String -
Available on String, provided by the StringExtensions extension
Truncate string to specified length with ellipsis