阅读(4066)
赞(1)
Laravel 8 Str::padLeft() {#collection-method}
2021-07-03 16:54:19 更新
Str::padLeft 方法包装了 PHP 的 str_pad 函数,在指定字符串的左侧填充上另一字符串:
use Illuminate\Support\Str;
$padded = Str::padLeft('James', 10, '-=');
// '-=-=-James'
$padded = Str::padLeft('James', 10);
// ' James' 
