I am trying to standardize the data in an autocomplete feature by removing all special characters. However, I am unsure how to replace the character "-" with a whitespace.
I typically use VCS as my code editor.
I attempted using %20 as a replacement, but it did not work.
var accentMap = {
"è": "e",
"é": "e",
"-": "%20"
};
var normalize = function (term) {
var ret = "";
for (var i = 0; i < term.length; i++) {
ret += accentMap[term.charAt(i)] || term.charAt(i);
}
return ret;
};