Skip to content
pubscout

stringr

1.2.2, released 8 months ago by chinmaykabi.com

Comprehensive string manipulation library supporting Latin, non-Latin, and grapheme clusters.

WASM-ready
$ flutter pub add stringr
Source repository

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.

Works with

Packages commonly used together with stringr: ones it builds on, ones built on it, and its own family.