Java Script: Remove space in a String

How to remove spaces from a string in java script?

Add the following code snippet in your your java script code:


String.prototype.contains = function(it) { return this.indexOf(it) != -1; };
function removeSpace(text){
   while(text.contains(' ')){
       text=text.replace(' ','');
   }
}

Popular posts from this blog

Android: where to run keytool command in android

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine