left_pad
Ruby implementation famous npm’s left-pad is finally here - https://github.com/atipugin/left_pad
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Ruby implementation famous npm’s left-pad is finally here - https://github.com/atipugin/left_pad
Comments
Haha, and the one-liner..
class String;alias :leftpad :rjust end
Yeah, but the goal was to pass original test cases ;)
Can I get this as a gem?
Never mind, gem is already there, time to add it to Gemfile
Adding it too, I hope it doesn’t get yanked.
Thx, for porting this marvellous js library to ruby.
Post a comment