See also: padC, padR |
Inserts padding on the left, returning a character string from a character expression padded to a specified length.
JSV_padL(expS, expN [, expP])
expS.padL(expN [, expP])
The padL functions returns the specified expression padded on the left side.
The padL functions use the following arguments.
Argument | Description |
expS | The character to be padded. |
expN | Specifies the total number of characters in the expression after it is padded. |
expP | The value used for padding. If expP is omitted, spaces are used for padding. If expP is included, the value of expP is repeated as necessary to pad the expression expS to a length of expN characters. |
n/a
The following lines of code
var testString = "Busy";
document.write( JSV_padL(testString, 12, "@") );
testString = "1234";
document.write( JSV_padL(testString, 12, "-") );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.