How to Replace any Character or Word in Javascript?

 Posted by vishalneeraj-24503 on 12/19/2013 | Category: JavaScript Interview questions | Views: 2164 | Points: 40

With the help of Replace in-built Javascript Function,we can replace any Character or Word in Javascript.

For Example:-

function replace_word()

var text = "Vishal Kumar";
var result = text.replace("Kumar","Neeraj");

Here, Kumar will be replaced with Neeraj.So,the output would be Vishal Neeraj.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response