Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Trim Function

Reply
Thread Tools

Trim Function

 
 
aroraamit81@gmail.com
Guest
Posts: n/a
 
      11-29-2005
Does java script provides inbuilt trimming function, if not then what
is the solution.

Thanks,

Amit Arora

 
Reply With Quote
 
 
 
 
Julian Turner
Guest
Posts: n/a
 
      11-29-2005

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

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      11-29-2005
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM? FAQ server Javascript 2 04-24-2007 01:59 AM
FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM? FAQ server Javascript 26 02-26-2007 05:06 PM
FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM? FAQ server Javascript 6 12-25-2006 08:47 PM
FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM? FAQ server Javascript 0 10-25-2006 11:00 PM
FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM? FAQ server Javascript 0 08-28-2006 11:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57