[Solved] why does str.replace() only replace the first found item?


Add the global selection “g” flag and use a regex instead of a string in first parameter.

result = text.replace(/\//g, "");

3

solved why does str.replace() only replace the first found item?