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(' ','');
   }
}

Comments

Popular posts from this blog

Read Images from a xlsx file using Apache POI

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

How to create mail message in FRC822 format