By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

Trim Function

P: n/a
Does java script provides inbuilt trimming function, if not then what
is the solution.

Thanks,

Amit Arora

Nov 29 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ar*********@gmail.com said the following on 11/29/2005 7:29 AM:
Does java script provides inbuilt trimming function
No.
if not then what is the solution.


Write your own.

Or, read the group FAQ.
<URL: http://jibbering.com/faq/#FAQ4_16>

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 29 '05 #2

P: n/a

aroraami...@gmail.com wrote:
Does java script provides inbuilt trimming function,
No
if not then what
is the solution.


One solution is:-

function Trim(s)
{
return s.replace(/^\s+|\s+$/g,"");
}

If you search this newsgroup you will find many others.

Regards

Julian Turner

Nov 29 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.