Skip to main content
1

πŸ—‘οΈ Removal & Extraction

extractDigits()
String
Extracts all numerical digits from the string and returns them as a new string. All non-digit characters are removed.
final messy = 'Price: $12.99 USD';
print(messy.extractDigits()); // "1299"
removeAllDigits()
String
Removes all numerical digits (0-9) from the string.
final mixed = 'Address line 123 Street 4';
print(mixed.removeAllDigits()); // "Address line  Street "
removeAllWhiteSpaces()
String
Removes all whitespace characters (spaces, tabs, newlines) from the string.
final long = 'one two\nthree';
print(long.removeAllWhiteSpaces()); // "onetwothree"
removeAllWordsStartingWithNumber()
String
Removes words that begin with a number (e.g., β€˜3rd’, β€˜10users’) and cleans up extra spaces.
final input = '10users 3rd place is here 54.';
print(input.removeAllWordsStartingWithNumber()); // "place is here 54."
getWords()
String
Extracts all individual words from the string based on word boundaries. Useful for keyword extraction.
final sentence = 'The Flutter app is amazing!';
print(sentence.getWords()); // ["The", "Flutter", "app", "is", "amazing"]
2

πŸ›‘οΈ Validation

isDigitsOnly()
bool
Checks if the entire string consists only of numerical digits (0-9).
print('12345'.isDigitsOnly());   // true
print('123 a'.isDigitsOnly());   // false
isTextOnly()
bool
Checks if the entire string consists only of alphabet letters (a-z, A-Z).
print('Flutter'.isTextOnly());    // true
print('Flutter Dev'.isTextOnly()); // false (contains space)
3

βœ‚οΈ Splitting

splitByUpperCase()
List<String>
Splits a string into a list of substrings whenever an uppercase letter is encountered. Ideal for converting PascalCase to readable words.
final camel = 'UserProfileData';
print(camel.splitByUpperCase()); // ["User", "Profile", "Data"]

πŸ—‘οΈ Removal & Extraction

πŸ›‘οΈ Validation

βœ‚οΈ Splitting