title: Javascript: how to remove punctuation from the end of a string
body: <p>Disclaimer: I'm new to programming! I did look through S.O. to find the answer to this question before posting, but didn't find the answer I need. </p>
  
  <p>Right now, the API I'm working with is returning a variable: 'description'. 'description' is a dynamic, 250-character string with punctuation.</p>
  
  <p>I have to truncate the string to 110 characters and then insert an ellipsis after it. This is easy enough - I've been using something like:</p>
  
  <pre><code>description.slice(0,110) + "..."
  </code></pre>
  
  <p>But the above is problematic because I have no way of predicting what character my string will truncate on. If it truncates on punctuation or a white space, the result looks really silly:</p>
  
  <p><a href="https://i.stack.imgur.com/kR2Jq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kR2Jq.png" alt="enter image description here"></a></p>
  
  <p>I've been reading a lot of similar inquiries where developers want to know how to take off one punctuating character at the end of a string. But I might have to take off several punctuating characters, depending on how much punctuation or white space is returned with the variable.</p>
  
  <p>Can anyone advise me on the best way to go about this? If I can provide any additional information, please let me know.</p>