dojo.string.pad
dojo.require("dojo.string");
defined in dojo/string.js
Pad a string to guarantee that it is at least size
length by filling with the character ch
at either the start or end of the string. Pads at the start, by default.
parameter | type | description |
---|---|---|
text | String | the string to pad |
size | Integer | length to provide padding |
ch | String | Optional. character to pad, defaults to '0' |
end | Boolean | Optional. adds padding at the end if true, otherwise pads at start |