Trim Function

Discussion in 'Javascript' started by aroraamit81@gmail.com, Nov 29, 2005.

  1. Guest

    Does java script provides inbuilt trimming function, if not then what
    is the solution.

    Thanks,

    Amit Arora
     
    , Nov 29, 2005
    #1
    1. Advertising

  2. 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
     
    Julian Turner, Nov 29, 2005
    #2
    1. Advertising

  3. Randy Webb Guest

    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/
     
    Randy Webb, Nov 29, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FAQ server
    Replies:
    0
    Views:
    150
    FAQ server
    Aug 29, 2006
  2. FAQ server
    Replies:
    0
    Views:
    152
    FAQ server
    Oct 26, 2006
  3. FAQ server
    Replies:
    6
    Views:
    228
    Jonas Raoni
    Dec 25, 2006
  4. FAQ server
    Replies:
    26
    Views:
    319
    Dr J R Stockton
    Feb 26, 2007
  5. FAQ server
    Replies:
    2
    Views:
    141
    -Lost
    Apr 24, 2007
Loading...

Share This Page