Answer: 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");
alert(result);
}
Here, Kumar will be replaced with Neeraj.So,the output would be Vishal Neeraj.
Asked In: Many Interviews |
Alert Moderator