var str = "JavaScript replace method test"; var res = str.replace("test", "success"); //res = Javscript replace method success