ExtJS Learning-----------Ext.string,extjs extension to String in JavaScript

Source: Internet
Author: User

For a ExtJS extension to a string in JavaScript, refer to its Help documentation, document: http://download.csdn.net/detail/z1137730824/7748893

Some of these methods are described below:

(1) Capitalize

Capitalize (String String): String

Returns a string in which the first letter in the string is uppercase

Parameters
    • string : String

      The string to convert

Returns
    • String

      Converted String

(2) ellipsis

Ellipsis (String value, number length, Boolean word): String

Crop a string greater than the specified length, increasing the display of the ellipsis (' ... ')

Parameters
  • value : String

    The string to clip

  • Length : number

    To crop the maximum allowable length

  • Word : Boolean

    If true, an attempt is made to find a common word character

(3) Trim

TrimString String): String

Crop whitespace characters on both sides of the string, preserving the middle whitespace, for example: @example

vars= ' foo bar ';Alert('-' +s+ '-');         //print "-foo Bar-"Alert('-' + Ext.String.Trim(s) + '-');  //print "-foo bar-"
Parameters
  
 
    • string : String

      The string to clip

Returns
    • String

      A clipped string

(4) uncapitalize

Uncapitalize (String String): String

Returns a string in which the first letter of the string is a lowercase letter

Parameters
    • string : String

      The string to convert

Returns
    • String

      Converted String

(5) Urlappend

Urlappend (string URL, string string): String

Append the content to the URL of the query string, according to the processing logic to determine the placement of a '? ' or ' & ' symbol.

Parameters
    • URL : String

      The URL to append to.

    • string : String

      The content to add to the URL.

Returns
    • String

      The URL that is generated.



ExtJS Learning-----------Ext.string,extjs extension to String in JavaScript

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.