StringExtensions extension
Comprehensive String extensions for Flutter applications
Provides utility methods for common string operations including capitalization, validation, formatting, and transformation.
- on
Properties
- capitalizeFirst → String
-
Available on String, provided by the StringExtensions extension
Capitalizes the first letter while preserving the restno setter - capitalizeFirstOfEach → String
-
Available on String, provided by the StringExtensions extension
Capitalizes the first letter of each wordno setter - fileExtension → String
-
Available on String, provided by the StringExtensions extension
Gets file extension from file path/nameno setter - fileNameWithoutExtension → String
-
Available on String, provided by the StringExtensions extension
Gets filename without extensionno setter - hasValidAudioExtension → bool
-
Available on String, provided by the StringExtensions extension
no setter - hasValidImageExtension → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a valid file extensionno setter - hasValidVideoExtension → bool
-
Available on String, provided by the StringExtensions extension
no setter - isAlpha → bool
-
Available on String, provided by the StringExtensions extension
Checks if string contains only alphabetic charactersno setter - isAlphaNumeric → bool
-
Available on String, provided by the StringExtensions extension
Checks if string contains only alphanumeric charactersno setter - isNumeric → bool
-
Available on String, provided by the StringExtensions extension
Checks if string contains only numeric charactersno setter - isPalindrome → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is palindromeno setter - isValidEmail → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a valid emailno setter - isValidPhone → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a valid phone numberno setter - isValidUrl → bool
-
Available on String, provided by the StringExtensions extension
Checks if string is a valid URLno setter - removeAt → String
-
Available on String, provided by the StringExtensions extension
Removes '@' from the beginning if presentno setter - startsWithAt → String
-
Available on String, provided by the StringExtensions extension
Ensures the string starts with '@' for usernamesno setter - startsWithHash → String
-
Available on String, provided by the StringExtensions extension
Ensures the string starts with '#' for hashtagsno setter
Methods
-
addThousandSeparators(
{String separator = ','}) → String -
Available on String, provided by the StringExtensions extension
Adds thousand separators to numeric string -
capitalizeFirstLetter(
) → String -
Available on String, provided by the StringExtensions extension
Capitalizes only the first letter of the string -
countOccurrences(
String substring) → int -
Available on String, provided by the StringExtensions extension
Counts occurrences of substring -
formatAsCurrency(
{String symbol = '\$'}) → String -
Available on String, provided by the StringExtensions extension
Formats string as currency -
formatAsPhone(
) → String -
Available on String, provided by the StringExtensions extension
Formats string as phone number -
getInitials(
[int? maxInitials]) → String -
Available on String, provided by the StringExtensions extension
Gets initials from full name -
maskCreditCard(
) → String -
Available on String, provided by the StringExtensions extension
-
maskEmail(
) → String -
Available on String, provided by the StringExtensions extension
Masks string for privacy (e.g., credit cards, emails) -
removeExtraWhitespace(
) → String -
Available on String, provided by the StringExtensions extension
Removes extra whitespace (multiple spaces become single space) -
removeWhitespace(
) → String -
Available on String, provided by the StringExtensions extension
Removes all whitespace characters -
repeat(
int times) → String -
Available on String, provided by the StringExtensions extension
Repeats string n times -
reverse(
) → String -
Available on String, provided by the StringExtensions extension
Reverses the string -
toCamelCase(
) → String -
Available on String, provided by the StringExtensions extension
Converts string to camelCase -
toColor(
) → Color? -
Available on String, provided by the StringExtensions extension
Converts hex color string to Color object -
toKebabCase(
) → String -
Available on String, provided by the StringExtensions extension
Converts string to kebab-case -
toPascalCase(
) → String -
Available on String, provided by the StringExtensions extension
Converts string to PascalCase -
toSentenceCase(
) → String -
Available on String, provided by the StringExtensions extension
Converts to sentence case (first letter of sentence capitalized) -
toSnakeCase(
) → String -
Available on String, provided by the StringExtensions extension
Converts string to snake_case -
toTitleCase(
) → String -
Available on String, provided by the StringExtensions extension
Converts to title case (each word capitalized) -
truncate(
int maxLength, {String ellipsis = '...'}) → String -
Available on String, provided by the StringExtensions extension
Truncates string to specified length with ellipsis -
wrap(
String wrapper, [String? endWrapper]) → String -
Available on String, provided by the StringExtensions extension
Wraps string with specified characters