Codeasearch.com - Search your code with us Login | Register | Contact us
  Forums > Javascript > trim function for javascript
webhelp
Posted on Dec 3, 2008
Join Date: November 2008
Location: India ( Chennai )
Posts: 21
 
trim function for javascript  

Hi,
Everybody know that there is no trim function in javascript. So you use this.

function trim(str){
return str.replace(/^s+|s+$/g,'');
}

 Hot Discussion
Go Tech launches Android tablet for Rs 3,999...
Sony targets retailers with quick sales pitches and rew...
Share and discover new activities with Google Schemer...
Samsung gets 9 mn preorders for Galaxy S3: Report...
Google revamps search engine to think like a person...
 
 Discussion Topics
IT News
Php
Javascript
Technology Updates
Asp.Net
MySql
Ajax
Html
Fedora
Software Testing
Asp
Java
General
Flash
Ruby on Rails