Reply to post: Re: Left padding

How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript

Anonymous Coward
Anonymous Coward

Re: Left padding

Get yerself a proper language. Y'know, something which doesn't require manually defined functions to left pad a string.

s/^(.*)/$padchar x ($wantlength-length($_)+1) .$1/e;'

If only we had something... something which had been around since 1987...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019