29.07.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Helper Functions 277<br />

str_contains() {#collection-method}<br />

The str_contains function determines if the given string contains the given value:<br />

.<br />

1 $value = str_contains('This is my name', 'my');<br />

2<br />

3 // true<br />

str_finish() {#collection-method}<br />

The str_finish function adds a single instance of the given value to a string:<br />

.<br />

1 $string = str_finish('this/string', '/');<br />

2<br />

3 // this/string/<br />

str_is() {#collection-method}<br />

The str_is function determines if a given string matches a given pattern. Asterisks may be used to<br />

indicate wildcards:<br />

.<br />

1 $value = str_is('foo*', 'foobar');<br />

2<br />

3 // true<br />

4<br />

5 $value = str_is('baz*', 'foobar');<br />

6<br />

7 // false<br />

str_plural() {#collection-method}<br />

The str_plural function converts a string to its plural form. This function currently only supports<br />

the English language:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!