title: SMARTY : Remove whitespace at the beginning or end of my string in Smarty template?
body: <p>Here's my string seperated by commas (,)
  <code>$myStr = "One, Two,Three, Four , Five ,Six "</code></p>
  
  <p>I am able successfully explode it <code>{assign var="options" value=","|explode:$myStr}</code></p>
  
  <p>But I also would like to remove whitespace at the beginning or end from each string when outputting it. In other words: I am looking for a <strong>SMARTY</strong> function equivalent to PHP's built-in <code>trim($mystr)</code> function. PHP trim will remove the start and end white-spaces if it present, otherwise return the actual string.</p>
  
  <pre><code>{section name=myname loop=$options}
     {$options[myname]}
  {/section}
  </code></pre>
  
  <p>The code above would output:</p>
  
  <blockquote>
  <pre><code>One
  Two
  Three
  [whitespace]Four[whitespace]
  [whitespace]Five[whitespace]
  Six[whitespace]
  </code></pre>
  </blockquote>
  
  <p>How can I trim whitespaces?</p>