JavaScript Remove Spaces

by Prabakaran 2012-08-30 17:47:14

<html>
<h2>JavaScript Remove Spaces</h2>
<script language="javascript" type="text/javascript">
var string="All glitters are not gold";
var newString=string.split(' ').join('');
document.write("The original string is = "+string+"<br>");
document.write("After removing the spaces, the string becomes = "+newString);
</script>
</html>
807
like
0
dislike
0
mail
flag

You must LOGIN to add comments