title: Replace and Rearrange string in javascript
body: <p>I have an input string </p>
  
  <pre><code>this.name in ['Sachin','Rahul','Anil']
  </code></pre>
  
  <p>If I find " in " in the above string, I need to replace this as below</p>
  
  <pre><code>['Sachin','Rahul','Anil'].indexOf(this.name) &gt; -1
  </code></pre>
  
  <p>Similarly, If I have an input string containing not in</p>
  
  <pre><code>this.name not in ['Sachin','Rahul','Anil']
  </code></pre>
  
  <p>If " not in " is found, I need to replace it as</p>
  
  <pre><code>['Sachin','Rahul','Anil'].indexOf(this.name)  &lt; 0
  </code></pre>
  
  <p>Is it possible to achieve this in javascript?</p>