Answers for "js replaceall examples"

1

javascript replaceall

//as of August 2020, not supported on older browsers
str.replaceAll("abc","def")
Posted by: Guest on October-17-2020
-1

javascript replace all with variable

/**
*A better method for replacing strings is as follows:
**/
function replaceString(oldString, newString, fullString) {
  return fullS.split(oldS).join(newS)
}
replaceString('World', 'Web', 'Brave New World')//'Brave New Web'
replaceString('World', 'Web', 'World New World')//'Web New Web'
Posted by: Guest on December-15-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language