阅读(873) (0)

Laravel 8 afterLast {#collection-method}

2021-07-03 16:54:24 更新

afterLast 方法返回字符串中指定值最后一次出现后的所有内容。如果字符串中不存在这个值,它将返回整个字符串:

use Illuminate\Support\Str;

$slice = Str::of('App\Http\Controllers\Controller')->afterLast('\\');

// 'Controller'