title: javascript find string and delete all the following character
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5631384/remove-everything-after-a-certain-character">Remove everything after a certain character</a>  </p>
  </blockquote>
  
  
  
  <p>what if I have</p>
  
  <pre><code>var shot = www.site.com/ask
  </code></pre>
  
  <p>and I wanted to remove all character after "/" (including "/").
  So that the result will be</p>
  
  <pre><code>www.site.com
  </code></pre>
  
  <p>NOTE: shot is dynamically changing value
  and this will all done on javascript.</p>