DaravelString extension

Str as methods on the string (Laravel's Str::of() chain): rawTitle.after(':').squish().slug(). Members that String already has (contains, startsWith, padLeft, …) keep their Dart meaning; use Str for Laravel's versions of those.

on

Properties

isAscii → bool

Available on String, provided by the DaravelString extension

Whether it is 7-bit ASCII only.
no setter
isJson → bool

Available on String, provided by the DaravelString extension

Whether it is valid JSON.
no setter
isUlid → bool

Available on String, provided by the DaravelString extension

Whether it is a ULID.
no setter
isUuid → bool

Available on String, provided by the DaravelString extension

Whether it is a UUID.
no setter
wordCount → int

Available on String, provided by the DaravelString extension

The number of words.
no setter

Methods

after(String search) → String

Available on String, provided by the DaravelString extension

What follows the first search.
afterLast(String search) → String

Available on String, provided by the DaravelString extension

What follows the last search.
ascii() → String

Available on String, provided by the DaravelString extension

Transliterated to ASCII, as Str.ascii.
before(String search) → String

Available on String, provided by the DaravelString extension

What precedes the first search.
beforeLast(String search) → String

Available on String, provided by the DaravelString extension

What precedes the last search.
between(String from, String to) → String

Available on String, provided by the DaravelString extension

What lies between from and to.
camel() → String

Available on String, provided by the DaravelString extension

camelCase, as Str.camel.
containsAll(Iterable<String> needles, {bool ignoreCase = false}) → bool

Available on String, provided by the DaravelString extension

Whether it contains every one of needles.
finish(String cap) → String

Available on String, provided by the DaravelString extension

Ends with cap once.
headline() → String

Available on String, provided by the DaravelString extension

Headline Case from any casing, as Str.headline.
kebab() → String

Available on String, provided by the DaravelString extension

kebab-case, as Str.kebab.
lcfirst() → String

Available on String, provided by the DaravelString extension

First character lower case, as Str.lcfirst.
limit([int limit = 100, String end = '...']) → String

Available on String, provided by the DaravelString extension

Cut to limit characters, followed by end.
mask(String character, int index, [int? length]) → String

Available on String, provided by the DaravelString extension

Masks length characters from index with character.
plural([num count = 2]) → String

Available on String, provided by the DaravelString extension

The plural, unless count is 1, as Str.plural.
pluralStudly([num count = 2]) → String

Available on String, provided by the DaravelString extension

The plural of the last word of a StudlyCase string.
singular() → String

Available on String, provided by the DaravelString extension

The singular, as Str.singular.
slug({String separator = '-'}) → String

Available on String, provided by the DaravelString extension

A URL slug, as Str.slug.
snake([String delimiter = '_']) → String

Available on String, provided by the DaravelString extension

snake_case, as Str.snake.
squish() → String

Available on String, provided by the DaravelString extension

Whitespace collapsed to single spaces and trimmed.
start(String prefix) → String

Available on String, provided by the DaravelString extension

Starts with prefix once.
studly() → String

Available on String, provided by the DaravelString extension

StudlyCase, as Str.studly.
title() → String

Available on String, provided by the DaravelString extension

Title Case, as Str.title.
trimChars(String chars) → String

Available on String, provided by the DaravelString extension

Without the characters of chars at either end.
ucfirst() → String

Available on String, provided by the DaravelString extension

First character upper case, as Str.ucfirst.
ucwords() → String

Available on String, provided by the DaravelString extension

Every word capitalized, as Str.ucwords.
words([int count = 100, String end = '...']) → String

Available on String, provided by the DaravelString extension

Cut to count words, followed by end.