Class Index | File Index

Classes


Built-In Namespace _global_

Method Summary
Method Attributes Method Name and Description
 
pad(length, input, padding, right)
Pads strings on the right or left with user defined characters or strings.
Method Detail
{String} pad(length, input, padding, right)
Pads strings on the right or left with user defined characters or strings.
Defined in: atropa-string-pad.js.
Author: Matthew Christopher Kastor-Inare III
☭ Hial Atropa!! ☭.
 console.log(
     pad(1, 'wee', 'um')
 );
 // logs wee

 console.log(
     pad(1, 'wee', 'um', true)
 );
 // logs wee

 console.log(
     pad(6, 'wee', 'um')
 );
 // logs umuwee

 console.log(
     pad(6, 'wee', 'um', true)
 );
 // logs weeumu
Parameters:
{Number} length
The desired length of the string.
{String|Number} input
The string or number to pad.
{String} padding
The string to use for padding, may be one or more characters.
{Boolean} right
set to true if you want to pad to the right. Defaults to left padding.
Returns:
{String} Returns a string whose length is equal to the given length.

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Sep 03 2013 13:59:59 GMT-0400 (EDT)