title: Javascript - how to remove all characters after a certain set of characters?
body: <p>I have a filename stored in a cookie, ex. filename.jpg but in IE for some reason it adds some characters after ".jpg" </p>
  
  <p>How can I remove all the characters after ".jpg"?</p>
  
  <p>I only find solutions for removing n number of characters, but the problem is that I'm not sure if the number of characters will remain constant, so I would like to treat it as undefined.</p>