> ## Documentation Index
> Fetch the complete documentation index at: https://starrycodes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# String - Regex & Cleaning

> Advanced string manipulation using built-in regular expressions for extracting digits, filtering words, removing whitespace, and checking content types.

### 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.

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
final messy = 'Price: $12.99 USD';
print(messy.extractDigits()); // "1299"
```

**removeAllDigits()** `String`

Removes all numerical digits (`0-9`) from the string.

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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.

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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.

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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.

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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`).

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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`).

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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.

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
final camel = 'UserProfileData';
print(camel.splitByUpperCase()); // ["User", "Profile", "Data"]
```

### 🗑️ Removal & Extraction

### 🛡️ Validation

### ✂️ Splitting


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.