title: Regular expression for remove last n characters
body: <p>I have a requirement to remove last n characters from string or remove 'page' from a particular string. 
  Eg: </p>
  
  <pre><code>var string = 'facebookpage';
  
  Expected output string = 'facebook'
  </code></pre>
  
  <p>I would like to remove 'page' from the string.</p>
  
  <p>Done it using substring. </p>
  
  <pre><code>var str = "facebookpage";
  str = str.substring(0, str.length - 4);
  </code></pre>
  
  <p>Could you help me to find some better way to do it. </p>