Probably not when you can
trim($whatever);
Just using the php trim funcion..
Please remember laravel is a php framework, Taylor isn't going to make a helper out of every possible thing.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Amazingly, Trim functions are missing in Str::class.
I think it can be nice to have
Str::ltrim( ..)
Str::rtrim ( )
Str::trim ( )
and maybe some filling functions depending on pattern
Str::fill ($char, $len) which will generate a string filled with "len" times "char"
Str::rfill and Str::rfill( ) do the same to make a string match a certain length
Please or to participate in this conversation.