Laravel 8 isEmpty {#collection-method}
isEmpty
方法用于判断指定字符串是否为空:
use Illuminate\Support\Str;
$result = Str::of(' ')->trim()->isEmpty();
// true
$result = Str::of('Laravel')->trim()->isEmpty();
// false
isEmpty
方法用于判断指定字符串是否为空:
use Illuminate\Support\Str;
$result = Str::of(' ')->trim()->isEmpty();
// true
$result = Str::of('Laravel')->trim()->isEmpty();
// false