Ext.data.JsonP.Ext_String({"mixins":[],"code_type":"assignment","inheritable":false,"component":false,"meta":{},"mixedInto":[],"uses":[],"aliases":{},"parentMixins":[],"superclasses":[],"members":{"event":[],"property":[],"css_var":[],"method":[{"meta":{},"owner":"Ext.String","tagname":"method","name":"addCharacterEntities","id":"method-addCharacterEntities"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"capitalize","id":"method-capitalize"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"createVarName","id":"method-createVarName"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"ellipsis","id":"method-ellipsis"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"escape","id":"method-escape"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"escapeRegex","id":"method-escapeRegex"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"format","id":"method-format"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"htmlDecode","id":"method-htmlDecode"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"htmlEncode","id":"method-htmlEncode"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"leftPad","id":"method-leftPad"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"repeat","id":"method-repeat"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"resetCharacterEntities","id":"method-resetCharacterEntities"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"splitWords","id":"method-splitWords"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"toggle","id":"method-toggle"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"trim","id":"method-trim"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"uncapitalize","id":"method-uncapitalize"},{"meta":{},"owner":"Ext.String","tagname":"method","name":"urlAppend","id":"method-urlAppend"}],"css_mixin":[],"cfg":[]},"tagname":"class","extends":null,"html":"

Files

A collection of useful static methods to deal with strings

\n
Defined By

Methods

Adds a set of character entity definitions to the set used by\nhtmlEncode and htmlDecode. ...

Adds a set of character entity definitions to the set used by\nhtmlEncode and htmlDecode.

\n\n

This object should be keyed by the entity name sequence,\nwith the value being the textual representation of the entity.

\n\n
 Ext.String.addCharacterEntities({\n     'Ü':'Ü',\n     'ç':'ç',\n     'ñ':'ñ',\n     'è':'è'\n });\n var s = Ext.String.htmlEncode(\"A string with entities: èÜçñ\");\n
\n\n

Note: the values of the character entites defined on this object are expected\nto be single character values. As such, the actual values represented by the\ncharacters are sensitive to the character encoding of the javascript source\nfile when defined in string literal form. Script tasgs referencing server\nresources with character entities must ensure that the 'charset' attribute\nof the script node is consistent with the actual character encoding of the\nserver resource.

\n\n

The set of character entities may be reset back to the default state by using\nthe resetCharacterEntities method

\n

Parameters

  • entities : Object

    The set of character entities to add to the current\ndefinitions.

    \n
Ext.String
view source
( String string ) : String
Capitalize the given string ...

Capitalize the given string

\n

Parameters

Returns

Converts a string of characters into a legal, parseable Javascript var name as long as the passed\nstring contains at ...

Converts a string of characters into a legal, parseable Javascript var name as long as the passed\nstring contains at least one alphabetic character. Non alphanumeric characters, and leading non alphabetic\ncharacters will be removed.

\n

Parameters

  • s : String

    A string to be converted into a var name.

    \n

Returns

  • String

    A legal Javascript var name.

    \n
Ext.String
view source
( String value, Number length, Boolean word ) : String
Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length ...

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length

\n

Parameters

  • value : String

    The string to truncate

    \n
  • length : Number

    The maximum length to allow before truncating

    \n
  • word : Boolean

    True to try to find a common word break

    \n

Returns

Ext.String
view source
( String string ) : String
Escapes the passed string for ' and \\ ...

Escapes the passed string for ' and \\

\n

Parameters

  • string : String

    The string to escape

    \n

Returns

Ext.String
view source
( String string ) : String
Escapes the passed string for use in a regular expression ...

Escapes the passed string for use in a regular expression

\n

Parameters

Returns

Ext.String
view source
( String string, String value1, String value2 ) : String
Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. ...

Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each\ntoken must be unique, and must increment in the format {0}, {1}, etc. Example usage:

\n\n
    var cls = 'my-class', text = 'Some text';\n    var s = Ext.String.format('<div class=\"{0}\">{1}</div>', cls, text);\n    // s now contains the string: '<div class=\"my-class\">Some text</div>'\n           
\n\n

Parameters

  • string : String

    The tokenized string to be formatted

    \n
  • value1 : String

    The value to replace token {0}

    \n
  • value2 : String

    Etc...

    \n

Returns

Ext.String
view source
( String value ) : String
Convert certain characters (&, <, >, ', and \") from their HTML character equivalents. ...

Convert certain characters (&, <, >, ', and \") from their HTML character equivalents.

\n

Parameters

  • value : String

    The string to decode

    \n

Returns

Ext.String
view source
( String value ) : String
Convert certain characters (&, <, >, ', and \") to their HTML character equivalents for literal display in web ...

Convert certain characters (&, <, >, ', and \") to their HTML character equivalents for literal display in web pages.

\n

Parameters

  • value : String

    The string to encode

    \n

Returns

Ext.String
view source
( String string, Number size, [String character] ) : String
Pads the left side of a string with a specified character. ...

Pads the left side of a string with a specified character. This is especially useful\nfor normalizing number and date strings. Example usage:

\n\n
    var s = Ext.String.leftPad('123', 5, '0');\n    // s now contains the string: '00123'\n           
\n\n

Parameters

  • string : String

    The original string

    \n
  • size : Number

    The total length of the output string

    \n
  • character : String (optional)

    The character with which to pad the original string (defaults to empty string \" \")

    \n

Returns

Ext.String
view source
( String pattern, Number count, String sep )
Returns a string with a specified number of repititions a given string pattern. ...

Returns a string with a specified number of repititions a given string pattern.\nThe pattern be separated by a different string.

\n\n
 var s = Ext.String.repeat('---', 4); // = '------------'\n var t = Ext.String.repeat('--', 3, '/'); // = '--/--/--'\n
\n

Parameters

  • pattern : String

    The pattern to repeat.

    \n
  • count : Number

    The number of times to repeat the pattern (may be 0).

    \n
  • sep : String

    An option string to separate each pattern.

    \n
Resets the set of character entity definitions used by\nhtmlEncode and htmlDecode back to the\ndefault state. ...

Resets the set of character entity definitions used by\nhtmlEncode and htmlDecode back to the\ndefault state.

\n
Splits a string of space separated words into an array, trimming as needed. ...

Splits a string of space separated words into an array, trimming as needed. If the\nwords are already an array, it is returned.

\n

Parameters

Ext.String
view source
( String string, String value, String other ) : String
Utility function that allows you to easily switch a string between two alternating values. ...

Utility function that allows you to easily switch a string between two alternating values. The passed value\nis compared to the current string, and if they are equal, the other value that was passed in is returned. If\nthey are already different, the first value passed in is returned. Note that this method returns the new value\nbut does not change the current string.

\n\n
        // alternate sort directions\n        sort = Ext.String.toggle(sort, 'ASC', 'DESC');\n\n        // instead of conditional logic:\n        sort = (sort == 'ASC' ? 'DESC' : 'ASC');\n           
\n\n

Parameters

  • string : String

    The current string

    \n
  • value : String

    The value to compare to the current string

    \n
  • other : String

    The new value to use if the string already equals the first value passed in

    \n

Returns

Ext.String
view source
( String string ) : String
Trims whitespace from either end of a string, leaving spaces within the string intact. ...

Trims whitespace from either end of a string, leaving spaces within the string intact. Example:\n@example

\n\n
var s = '  foo bar  ';\nalert('-' + s + '-');         //alerts \"- foo bar -\"\nalert('-' + Ext.String.trim(s) + '-');  //alerts \"-foo bar-\"\n
\n

Parameters

  • string : String

    The string to escape

    \n

Returns

Ext.String
view source
( String string ) : String
Uncapitalize the given string ...

Uncapitalize the given string

\n

Parameters

Returns

Ext.String
view source
( String url, String string ) : String
Appends content to the query string of a URL, handling logic for whether to place\na question mark or ampersand. ...

Appends content to the query string of a URL, handling logic for whether to place\na question mark or ampersand.

\n

Parameters

  • url : String

    The URL to append to.

    \n
  • string : String

    The content to append to the URL.

    \n

Returns

","subclasses":[],"name":"Ext.String","alternateClassNames":[],"inheritdoc":null,"files":[{"href":"String2.html#Ext-String","filename":"String.js"}],"html_meta":{},"singleton":true,"id":"class-Ext.String","statics":{"property":[],"event":[],"css_var":[],"method":[],"css_mixin":[],"cfg":[]},"requires":[]});