/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.String({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":null,"uses":[],"html":"
Files
These functions are available as static methods on the JavaScript String object.
\nUtility 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\nsort = sort.toggle('ASC', 'DESC');\n\n// instead of conditional logic:\nsort = (sort == 'ASC' ? 'DESC' : 'ASC');\n
\n\nThe value to compare to the current string
\nThe new value to use if the string already equals the first value passed in
\nThe new value
\nTrims whitespace from either end of a string, leaving spaces within the string intact. Example:
\n\nvar s = ' foo bar ';\nalert('-' + s + '-'); //alerts \"- foo bar -\"\nalert('-' + s.trim() + '-'); //alerts \"-foo bar-\"\n
\n\nThe trimmed string
\nAllows 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\nvar cls = 'my-class', text = 'Some text';\nvar s = String.format('<div class=\"{0}\">{1}</div>', cls, text);\n// s now contains the string: '<div class=\"my-class\">Some text</div>'\n
\n\nThe tokenized string to be formatted
\nThe value to replace token {0}
\nEtc...
\nThe formatted string
\nPads the left side of a string with a specified character. This is especially useful\nfor normalizing number and date strings. Example usage:
\n\nvar s = String.leftPad('123', 5, '0');\n// s now contains the string: '00123'\n
\n\nThe original string
\nThe total length of the output string
\nThe character with which to pad the original string (defaults to empty string \" \")
\nThe padded string
\n