Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

octal's avatar
Level 1

Trimming functions missing in Str::class

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

0 likes
2 replies
jlrdw's avatar

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.

Please or to participate in this conversation.