Posted By

ukpyr on 03/13/09


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


str_lpad - pad string to the left


 / Published in: Lua
 

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

Report this snippet  

You need to login to post a comment.