using regex with replace to replace all instances of something in a string
so you have a string and you want to replace a recurring character, use this to do it:
var string = "a-string-with-dashes.txt";
var string = "a-string-with-dashes.txt"; string = string.replace(/-/g , " ");
string should now =
a string with dashes.txt
You can edit the following strings to test or just run it to see the result.
String to Replace: