Revision: 13378
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 21, 2009 20:32 by duniyadnd
Initial Code
var str = "This string has too many spaces."; var result = str.replace(/(\s| |&\#160;)+/gi, "_"); document.write(result);
Initial URL
Initial Description
I'll never learn how to use this Markdown system. Anyway, here is the fixed code based on my comment on the following page: http://snipplr.com/view/14206/replace-spaces-with-underscores/ I'm sorry, I don't mean to hijack the code. :(
Initial Title
Replace space with _
Initial Tags
replace
Initial Language
JavaScript