Full version: jsB@nk » Utility » Converter » Ignore Spaces script
URL: https://www.javascriptbank.com/ignore-spaces-script.html
Removes spaces from a string variable within a script or from user input into a textbox. Several different uses are shown on the script example page.
Full version: jsB@nk » Utility » Converter » Ignore Spaces script
URL: https://www.javascriptbank.com/ignore-spaces-script.html
<SCRIPT LANGUAGE="JavaScript">// Mike McGrath ([email protected]) | http://website.lineone.net/~mike_mcgrath<!-- Beginfunction ignoreSpaces(string) {var temp = "";string = '' + string;splitstring = string.split(" ");for(i = 0; i < splitstring.length; i++)temp += splitstring[i];return temp;}// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<pre>Before: String = x xx xxx xxxx<br> After: String = <script language="JavaScript">document.write(ignoreSpaces("x xx xxx xxxx"));</script></pre><form><input type=text size=25 onBlur="this.value=ignoreSpaces(this.value);"><input type=button value="Ok"></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->