Answers for "strpad jquery"

0

strpad jquery

function pad (str, max) {
  str = str.toString();
  return str.length < max ? pad("0" + str, max) : str;
}

pad("3", 3);    // => "003"
pad("123", 5);  // => "00123"
pad("1234", 2); // => "1234"
Posted by: Guest on May-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language