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 firstsearch. -
afterLast(
String search) → String -
Available on String, provided by the DaravelString extension
What follows the lastsearch. -
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 firstsearch. -
beforeLast(
String search) → String -
Available on String, provided by the DaravelString extension
What precedes the lastsearch. -
between(
String from, String to) → String -
Available on String, provided by the DaravelString extension
What lies betweenfromandto. -
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 ofneedles. -
finish(
String cap) → String -
Available on String, provided by the DaravelString extension
Ends withcaponce. -
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 tolimitcharacters, followed byend. -
mask(
String character, int index, [int? length]) → String -
Available on String, provided by the DaravelString extension
Maskslengthcharacters fromindexwithcharacter. -
plural(
[num count = 2]) → String -
Available on String, provided by the DaravelString extension
The plural, unlesscountis 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 withprefixonce. -
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 ofcharsat 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 tocountwords, followed byend.