string.trimWhiteSpace()
clean white space of the given string
string.trimWhiteSpace( )
Returns: String
This function does not take any arguments.
Examples
res = " I love Lucee ";
<span class="nf">writeDump</span><span class="p">(</span><span class="k">var</span><span class="o">=</span><span class="nv">res</span><span class="p">,</span> <span class="nv">label</span><span class="o">=</span><span class="s2">"Original string"</span><span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="s2">"Before Trim the Whitespace <br />"</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="k">var</span><span class="o">=</span><span class="nf">res.len</span><span class="p">(),</span> <span class="nv">label</span><span class="o">=</span><span class="s2">"string length"</span><span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="s2">"After Trim the Whitespace <br />"</span><span class="p">);</span>
<span class="nf">writeDump</span><span class="p">(</span><span class="k">var</span><span class="o">=</span><span class="nf">res.trimWhitespace</span><span class="p">().</span><span class="k">len</span><span class="p">(),</span> <span class="nv">label</span><span class="o">=</span><span class="s2">"string length"</span><span class="p">);</span>