I'll never learn how to use this Markdown system. Anyway, here is the fixed code based on my comment on the following page:
I'm sorry, I don't mean to hijack the code. :(
- var str = "This string has too many spaces.";
- var result = str.replace(/(\s| |&\#160;)+/gi, "_");
You need to login to post a comment.