pad

Pad a String with another String, to a certain length.


Syntax


Parameters

  • String subject - The String to pad.
  • Number length - The length to pad the String to.
  • String padding - The String to use as padding (defaults to spaces).
  • Number type - Which side(s) to pad.
    • 0 - Pad the left-hand side of subject.
    • 1 (default) - Pad the right-hand side of subject.
    • 2 - Pad both sides of subject.


Result

Returns subject padded on the left, right, or both sides, to the specified length.

ptpscript/functions/pad.txt · Last modified: 2007/01/24 10:15
 
 
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki