string.lJustify()
Left justifies characters in a string of a specified length.
string.lJustify( length=number )
Returns: String
Examples
name = "yoyo".ljustify(10);
writeDump(name);
writeDump(len(name));
writeDump(len(trim(name)));
writeDump(len(ltrim(name)));
writeDump(len(rtrim(name)));
<span class="nf">writeoutput</span><span class="p">(</span><span class="s2">"<hr>"</span><span class="p">);</span>
<span class="nv">s</span> <span class="o">=</span> <span class="s2">""</span><span class="p">;</span>
<span class="nv">res</span> <span class="o">=</span> <span class="nf">s.lJustify</span><span class="p">(</span><span class="m">4</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="k">len</span><span class="p">(</span><span class="nv">res</span><span class="p">));</span>
<span class="nf">writeoutput</span><span class="p">(</span><span class="s2">"<pre>|</span><span class="s-Interp">#res#</span><span class="s2">|</pre><hr>"</span><span class="p">);</span>
<span class="nv">s</span> <span class="o">=</span> <span class="s2">"abc"</span><span class="p">;</span>
<span class="nv">res</span> <span class="o">=</span> <span class="nf">s.lJustify</span><span class="p">(</span><span class="m">4</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="k">len</span><span class="p">(</span><span class="nv">res</span><span class="p">));</span>
<span class="nf">writeoutput</span><span class="p">(</span><span class="s2">"<pre>|</span><span class="s-Interp">#res#</span><span class="s2">|</pre><hr>"</span><span class="p">);</span>
<span class="nv">s</span> <span class="o">=</span> <span class="s2">"10"</span><span class="p">;</span>
<span class="nv">res</span> <span class="o">=</span> <span class="nf">s.lJustify</span><span class="p">(</span><span class="m">4</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="k">len</span><span class="p">(</span><span class="nv">res</span><span class="p">));</span>
<span class="nf">writeoutput</span><span class="p">(</span><span class="s2">"<pre>|</span><span class="s-Interp">#res#</span><span class="s2">|</pre>"</span><span class="p">);</span>