title: Replace String with empty string
body: <p>I have a string that can have the following substring values (includes quotes too)</p>
  
  <pre><code>"+form"
  "+ form "
  " form+"
  "form +"
  + form
  +form
  form+
  form +
  form   +
  +    form
  ....
  ....
  .... or just simply 'form' that doesnt surrounded by double quotes
  </code></pre>
  
  <p>The problem is to find the substring (+ form or form +) that matches the following</p>
  
  <ul>
  <li>'+ form' should not be surrounded by quotes</li>
  <li><p>number of spaces between the '+' and 'form' are not limited</p>
  
  <p>If it is found, then it should be replaced by the empty string ""</p>
  
  <pre><code>Input:
  ' form+ "form" +  form '
  Output:
  "form"
  </code></pre>
  
  <blockquote>
    <p>Input:
           ' form'
           Output:
           'form'</p>
  </blockquote></li>
  </ul>
  
  <p>Any help?</p>
  
  <p>I'm just at beginner level, and it seems that I cannot solve this with simple replace and index of method :-(</p>
  
  <pre><code>var abc = string.replace(" " + "");
   if(abc.indexOf("+form") &gt; -1 || abc.indexOf("form+") &gt; -1 || abc.indexOf("form") &gt; -1 || abc.indexOf("\"+form\"") &gt; -1 || || abc.indexOf("\"form+\"") &gt; -1 )
   {
      // then what should do?
   }
  </code></pre>