<p>This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript.</p>

<p>Original string is <code>'original READ ONLY'</code></p>

<p>I want to replace the <code>'READ ONLY'</code> with <code>'READ WRITE'</code></p>

<p>Any quick answer please? Possibly with a javascript code snippet...</p>

Good
summary
. It is regexp based, if you use regexp notation you can specify the i and g modifiers (case insensitive (i), which will match regardless to case and global (g), which will replace all occurences), if you use string notation it'll get converted to a regex and you wont' be able to specify any modifier.
```
```
<script type="text/javascript">

var str1="Visit Microsoft!";
var str2 = str1.replace(/microsoft/i, "W3Schools"); //Will work, per the i modifier 

var str3 = "original READ ONLY";
var str4 = str3.replace("ONLY", "WRITE"); //Will also work

</script>
```
```