title: Truncate string on whole words in .NET C#
body: <p>I am trying to truncate some long text in C#, but I don't want my string to be cut off part way through a word. Does anyone have a function that I can use to truncate my string at the end of a word?</p>
  
  <p>E.g:</p>
  
  <pre><code>"This was a long string..."
  </code></pre>
  
  <p>Not:</p>
  
  <pre><code>"This was a long st..."
  </code></pre>