title: velocity: join optional fields with a separator/prefix
body: <p>What would be the most concise/readable way in a velocity template to join multiple fields with a separator while leaving out empty or null Strings without adding excess separators?</p>
  
  <p>As an example we have a tooltip or appointments that goes like:</p>
  
  <pre><code>Appointment ($number) [with $employee] [-] [$remarks] [-] [$roomToVisit]
  </code></pre>
  
  <p>Where I used brackets to indicate optional data. When filled in it would normally show as</p>
  
  <pre><code>Appointment (3) with John - serve Java coffee - ballroom
  </code></pre>
  
  <p>When $remarks is empty but $roomToVisit is not, this becomes:</p>
  
  <pre><code>Appointment (3) with John - ballroom
  </code></pre>
  
  <p>When instead $roomToVisit is empty we get:</p>
  
  <pre><code>Appointment (3) with John - serve Java coffee
  </code></pre>
  
  <p>When both are empty:</p>
  
  <pre><code>Appointment (3) with John
  </code></pre>
  
  <p><strong>Bonus</strong>: also make the field prefix optional. When only $employee is empty we should get:</p>
  
  <pre><code>Appointment (3) serve Java coffee - ballroom
  </code></pre>
  
  <p>Ideally I would like the velocity template to look very similar to the first code box. If this is not possible, how would you achieve this with a minimum of distracting code tags?</p>
  
  <p>Similar ideas (velocity example may help but is much more verbose):</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/6684574/join-with-intelligent-separators">Join with intelligent separators</a></li>
  <li><a href="https://stackoverflow.com/questions/8196828/velocity-do-something-except-in-last-loop-iteration">velocity: do something except in last loop iteration</a></li>
  </ul>