Posted By

ukpyr on 03/13/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


str_rpad - pad string to the right


 / Published in: Lua
 

  1. --- Pads str to length len with char from left
  2. string.rpad = function(str, len, char)
  3. if char == nil then char = ' ' end
  4. return string.rep(char, len - #str) .. str
  5. end

Report this snippet  

You need to login to post a comment.