Ask Ben: Javascript String Replace Method

strReplaceAll = strText.replace( new RegExp( "th", "gi" ), "[X]" );
 
alert( strReplaceAll );

For Cut-and-Paste