Language GuideBuilt-in TypesStringMethodsreplaceOn this pagereplaceReplace each instance of the substring with the specified string. "This is some example text... and this is some more".replace("is", "was"); // "Thwas was some example text... and thwas was some more" Syntax replace(source, target) Returns A new string containing the replaced substrings.