Skip to content

Instantly share code, notes, and snippets.

View jawdatls's full-sized avatar
💭
I may be slow to respond.

Jawdat Sobh jawdatls

💭
I may be slow to respond.
View GitHub Profile
@markshust
markshust / strPad.js
Created May 7, 2012 02:47
jquery str_pad
$.strPad = function(input, pad_length, pad_string, pad_type){
var output = input.toString();
if (pad_string === undefined) { pad_string = ' '; }
if (pad_type === undefined) { pad_type = 'STR_PAD_RIGHT'; }
if (pad_type == 'STR_PAD_RIGHT') {
while (output.length < pad_length) {
output = output + pad_string;
}
} else if (pad_type == 'STR_PAD_LEFT') {
while (output.length < pad_length) {