Laravel 8 start {#collection-method}
start
方法用于将某个值添加到字符串的头部,若该字符串没有以此值开头:
use Illuminate\Support\Str;
$adjusted = Str::of('this/string')->start('/');
// /this/string
$adjusted = Str::of('/this/string')->start('/');
// /this/string
start
方法用于将某个值添加到字符串的头部,若该字符串没有以此值开头:
use Illuminate\Support\Str;
$adjusted = Str::of('this/string')->start('/');
// /this/string
$adjusted = Str::of('/this/string')->start('/');
// /this/string