Sunday, June 14, 2009

How to Replace All in Javascript

How to replace all string using javascript replace function... Here is simple example replace all in javascript in replace string method.

  <Script Language="javascript">  
var str = "This is the test string.";
var rs = str.replace(/is/g,"");
document.write(st); // result "Th the test string."

No comments:

Post a Comment