Strings In Depth7 / 18
Up next

Replace text

const path = "a-b-c-d";
// replaceAll swaps every match; replace swaps only the first
console.log(path.replaceAll("-", "/"));
console.log(path.replace("-", "/"));
What you're solving

replace the first match or replaceAll