title: How can I limit a string to no more than a certain length?
body: <p>I tried the following:</p>
  
  <pre><code>var Title = LongTitle.Substring(0,20)
  </code></pre>
  
  <p>This works but not if LongTitle has a length of less than 20.  How can I limit strings to a maximum of 20 characters but not get an error if they are just for example 5 characters long?</p>