Mega Code Archive

 
Categories / JavaScript DHTML / Data Type
 

String replace

<html> <body> <button onclick="var myS = new String('Sample String');                   alert(myS.replace(/sam/i,'Text'));">String replace</button> </body> </html>