Implementation of jquery $. trim () to remove string spaces [legend] _ jquery

Source: Internet
Author: User
The following section describes how to remove string spaces by using jquery $. trim ]. I think it is quite good. Now I will share it with you and give you a reference. Let's take a look at it with xiaobian. Implementation of jquery $. trim () to remove string spaces [legend]

Syntax
The jQuery. trim () function removes spaces at both ends of a string.

Function
This function can remove the white spaces at the start and end of the string (until the first non-white string is encountered ). It clears common blank characters including line breaks, spaces, and tabs.

Parameters
If the str parameter is not of the string type, this function automatically converts it to a string (generally calls its toString () method ). If the str parameter is null or undefined, an empty string ("") is returned ("").

Return Value
The Return Value of the jQuery. trim () function is of the String type. The return value is the String after the blank strings at both ends are removed.

Example & Description

       My JSP 'index. jsp 'starting page  
   
   
     
   
   
       
ShowBtn ShowBtn1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.