title: How to check if last character in a string is 'space'?
body: <p>I have a code as follows in this <a href="http://jsfiddle.net/jc92619/872VH/1/" rel="noreferrer">fiddle</a>:</p>
  
  <pre><code>&lt;span id="someid"&gt;check this phrase &lt;/span&gt;&lt;br&gt;
  &lt;span id="result"&gt;&lt;/span&gt; 
  </code></pre>
  
  <p>Here I have placed a space after the word 'phrase', but when I put a conditional statement it always returns one result. How is it possible to check the end of the string for a space?</p>