stringr
1.2.2, released 8 months ago by chinmaykabi.com
Comprehensive string manipulation library supporting Latin, non-Latin, and grapheme clusters.
What it does
Provides advanced string operations including case conversion, unicode handling, truncation, slugification, and HTML escaping. It handles grapheme clusters and diacritics correctly using regex-based word detection.
AI-written summary of version 1.2.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need complex string operations like case conversions, slugification, or latinization.
- Your app works with non-Latin scripts, emojis, or grapheme clusters where standard Dart string methods fall short.
Skip it when
- You only need basic built-in Dart string operations.
- You require localized plural rules or heavy internationalization formatting.
Strengths
- Full Unicode and grapheme cluster support
- Smart word detection using regex patterns instead of simple whitespace splitting
- Zero heavy dependencies (only characters)
Weaknesses
- Does not provide localization or translation features
- Some legacy methods are deprecated in version 1.2.0
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add stringr to pubspec.yaml dependencies.
import 'package:stringr/stringr.dart';
void main() {
print('hello world'.toCamelCase);
print('café'.countGrapheme());
}Alternatives
Packages that do the same job and could replace stringr.
- validators2
String validation and sanitization for Dart.
83Compare - interpolation
A Dart package to handle dynamic String and Json interpolation.
48Compare - string_to_color
Convert strings to colors, hex strings, or hex integers in Dart and Flutter.
42Compare - date_kit
Dart package for DateTime manipulation, formatting, and parsing operations.
43Compare
Works with
Packages commonly used together with stringr: ones it builds on, ones built on it, and its own family.