title: How to know that a string starts/ends with a specific string in jQuery?
body: <p>I want to know if a string starts with the specified character/string or ends with it in jQuery.</p>
  
  <p><strong>For Example:</strong></p>
  
  <pre><code>var str = 'Hello World';
  
  if( str starts with 'Hello' ) {
     alert('true');
  } else {
     alert('false');
  }
  
  if( str ends with 'World' ) {
     alert('true');
  } else {
     alert('false');
  }
  </code></pre>
  
  <p>If there is not any function then any alternative ?</p>