Return to Snippet

Revision: 13347
at April 20, 2009 15:34 by ira


Initial Code
var str = "This string has too many spaces.";  
var result = str.replace(/\s/gi, "_"); 
document.write(result);

Initial URL

                                

Initial Description

                                

Initial Title
Replace Spaces with Underscores

Initial Tags
javascript

Initial Language
JavaScript