Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Java Programming Code Examples

Java > Core Java Code Examples

Java Script Trim() function

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Java Script Trim() function function fnTrim() { for(var L=0; L if(this.charAt(L)!=" ")break; for(R=this.length-1; R>=0;R--) if(this.charAt(R)!=" ")break; if(L==this.length)return ""; return this.substring(L,R+1); } String.prototype.trim=fnTrim; //**** For trim the crtl if ((document.frm.crtlName.value).trim()=="") { //*** Here ur code }