阅读(627) (7)

Laravel 8 substr {#collection-method}

2021-07-05 09:43:54 更新

substr 方法返回字符串中 start 和 length 的参数指定的字符串部分:

use Illuminate\Support\Str;

$string = Str::of('Laravel Framework')->substr(8);

// Framework

$string = Str::of('Laravel Framework')->substr(8, 5);

// Frame