diff --git a/strings.md b/strings.md index 10fc6be592..b430688d4d 100644 --- a/strings.md +++ b/strings.md @@ -48,6 +48,8 @@ Laravel includes a variety of functions for manipulating string values. Many of [Str::contains](#method-str-contains) [Str::containsAll](#method-str-contains-all) [Str::doesntContain](#method-str-doesnt-contain) +[Str::doesntEndWith](#method-str-doesnt-end-with) +[Str::doesntStartWith](#method-str-doesnt-start-with) [Str::deduplicate](#method-deduplicate) [Str::endsWith](#method-ends-with) [Str::excerpt](#method-excerpt) @@ -558,6 +560,40 @@ $doesntContain = Str::doesntContain('This is name', 'MY', ignoreCase: true); // true ``` + +#### `Str::doesntEndWith()` {.collection-method} + +The `Str::doesntEndWith` method determine if a given string doesn't start with a given substring: + +```php +use Illuminate\Support\Str; + +$doesntEndWith = Str::doesntEndWith('a7', 'a'); + +// true + +$doesntEndWith = Str::doesntEndWith('a7', '7'); + +// false +``` + + +#### `Str::doesntStartWith()` {.collection-method} + +The `Str::doesntStartWith` method determine if a given string doesn't end with a given substring: + +```php +use Illuminate\Support\Str; + +$doesntStartWith = Str::doesntStartWith('This is name', 'day'); + +// true + +$doesntStartWith = Str::doesntStartWith('This is name', 'This'); + +// false +``` + #### `Str::deduplicate()` {.collection-method}