<html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>pad-string</title><link rel="stylesheet" type="text/css" href="../reference.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.2"><link rel="home" href="../index.html" title="DocBook XSL Stylesheets: Reference Documentation"><link rel="up" href="utility.html" title="Common » Utility Template Reference"><link rel="prev" href="template.get.doc.title.html" title="get.doc.title"><link rel="next" href="charmap.html" title="Common » Character-Map Template Reference"><link rel="copyright" href="copyright.html" title="License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">pad-string</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="template.get.doc.title.html">Prev</a> </td><th width="60%" align="center">Common » Utility Template Reference</th><td width="20%" align="right"> <a accesskey="n" href="charmap.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="template.pad-string"></a><div class="titlepage"></div><div class="refnamediv"><h2>pad-string</h2><p>pad-string — Right-pads or left-pads a string out to a certain length</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis"><xsl:template name="pad-string"> <xsl:param name="padChar" select="' '"/> <xsl:param name="leftRight">left</xsl:param> <xsl:param name="padVar"/> <xsl:param name="length"/> ... </xsl:template></pre></div><div class="refsect1"><a name="d0e35178"></a><h2>Description</h2><p>This function takes string <em class="parameter"><code>padVar</code></em> and pads it out in the direction <em class="parameter"><code>rightLeft</code></em> to the string-length <em class="parameter"><code>length</code></em>, using string <em class="parameter"><code>padChar</code></em> (a space character by default) as the padding string (note that <em class="parameter"><code>padChar</code></em> can be a string; it is not limited to just being a single character).</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function began as a copy of Nate Austin's <code class="function">prepend-pad</code> function in the <a class="link" href="http://www.dpawson.co.uk/xsl/sect2/padding.html" target="_top">Padding Content</a> section of Dave Pawson's <a class="link" href="http://www.dpawson.co.uk/xsl/index.html" target="_top">XSLT FAQ</a>.</p></div></div><div class="refsect1"><a name="d0e35210"></a><h2>Returns</h2><p>Returns a (padded) string.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="template.get.doc.title.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="utility.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="charmap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">get.doc.title </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Common » Character-Map Template Reference</td></tr></table></div></body></html>