- Added additional `String` manipulation utilities, including:
  - `capitalizeWords`: Capitalizes the first letter of each word in the string.
  - `spacePascalCase`: Adds spaces between words in a PascalCase string.

Signed-off-by: Hans Kokx <hans.kokx@hackberry.se>
This commit is contained in:
Hans Kokx
2024-11-06 12:31:16 +01:00
parent c17cd7f6a3
commit 2c13b6fe72
3 changed files with 94 additions and 10 deletions
+14
View File
@@ -328,6 +328,20 @@ objects:
final String capitalized = text.capitalize; // "Hello"
```
- `capitalizeWords`: Capitalizes the first letter of each word in a given `String`
```dart
String text = "hello world";
String capitalizedWords = text.capitalizeWords; // "Hello World"
```
- `spacePascalCase`: Adds spaces between words in a PascalCase `String`
```dart
String text = "ArcaneHelperUtils";
String spaced = text.spacePascalCase; // "Arcane Helper Utils"
```
Additionally, the `CommonString` class provides a quick shortcut to common
strings, such as punctuation marks that are otherwise cumbersome to find or type.