Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / output / Ext.String.js
1 Ext.data.JsonP.Ext_String({
2   "tagname": "class",
3   "name": "Ext.String",
4   "doc": "<p>A collection of useful static methods to deal with strings</p>\n",
5   "extends": null,
6   "mixins": [
7
8   ],
9   "alternateClassNames": [
10
11   ],
12   "xtype": null,
13   "author": null,
14   "docauthor": null,
15   "singleton": true,
16   "private": false,
17   "cfg": [
18
19   ],
20   "method": [
21     {
22       "tagname": "method",
23       "name": "capitalize",
24       "member": "Ext.String",
25       "doc": "<p>Capitalize the given string</p>\n",
26       "params": [
27         {
28           "type": "String",
29           "name": "string",
30           "doc": "\n",
31           "optional": false
32         }
33       ],
34       "return": {
35         "type": "String",
36         "doc": "\n"
37       },
38       "private": false,
39       "static": false,
40       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
41       "linenr": 101,
42       "html_filename": "String.html",
43       "href": "String.html#Ext-String-method-capitalize",
44       "shortDoc": "<p>Capitalize the given string</p>\n"
45     },
46     {
47       "tagname": "method",
48       "name": "ellipsis",
49       "member": "Ext.String",
50       "doc": "<p>Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length</p>\n",
51       "params": [
52         {
53           "type": "String",
54           "name": "value",
55           "doc": "<p>The string to truncate</p>\n",
56           "optional": false
57         },
58         {
59           "type": "Number",
60           "name": "length",
61           "doc": "<p>The maximum length to allow before truncating</p>\n",
62           "optional": false
63         },
64         {
65           "type": "Boolean",
66           "name": "word",
67           "doc": "<p>True to try to find a common word break</p>\n",
68           "optional": false
69         }
70       ],
71       "return": {
72         "type": "String",
73         "doc": "<p>The converted text</p>\n"
74       },
75       "private": false,
76       "static": false,
77       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
78       "linenr": 110,
79       "html_filename": "String.html",
80       "href": "String.html#Ext-String-method-ellipsis",
81       "shortDoc": "<p>Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length</p>\n"
82     },
83     {
84       "tagname": "method",
85       "name": "escape",
86       "member": "Ext.String",
87       "doc": "<p>Escapes the passed string for ' and \\</p>\n",
88       "params": [
89         {
90           "type": "String",
91           "name": "string",
92           "doc": "<p>The string to escape</p>\n",
93           "optional": false
94         }
95       ],
96       "return": {
97         "type": "String",
98         "doc": "<p>The escaped string</p>\n"
99       },
100       "private": false,
101       "static": false,
102       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
103       "linenr": 140,
104       "html_filename": "String.html",
105       "href": "String.html#Ext-String-method-escape",
106       "shortDoc": "<p>Escapes the passed string for ' and \\</p>\n"
107     },
108     {
109       "tagname": "method",
110       "name": "escapeRegex",
111       "member": "Ext.String",
112       "doc": "<p>Escapes the passed string for use in a regular expression</p>\n",
113       "params": [
114         {
115           "type": "String",
116           "name": "string",
117           "doc": "\n",
118           "optional": false
119         }
120       ],
121       "return": {
122         "type": "String",
123         "doc": "\n"
124       },
125       "private": false,
126       "static": false,
127       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
128       "linenr": 131,
129       "html_filename": "String.html",
130       "href": "String.html#Ext-String-method-escapeRegex",
131       "shortDoc": "<p>Escapes the passed string for use in a regular expression</p>\n"
132     },
133     {
134       "tagname": "method",
135       "name": "format",
136       "member": "Ext.String",
137       "doc": "<p>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:</p>\n\n<pre><code>var cls = 'my-class', text = 'Some text';\nvar s = Ext.String.format('&lt;div class=\"{0}\">{1}&lt;/div>', cls, text);\n// s now contains the string: '&lt;div class=\"my-class\">Some text&lt;/div>'\n       </code></pre>\n\n",
138       "params": [
139         {
140           "type": "String",
141           "name": "string",
142           "doc": "<p>The tokenized string to be formatted</p>\n",
143           "optional": false
144         },
145         {
146           "type": "String",
147           "name": "value1",
148           "doc": "<p>The value to replace token {0}</p>\n",
149           "optional": false
150         },
151         {
152           "type": "String",
153           "name": "value2",
154           "doc": "<p>Etc...</p>\n",
155           "optional": false
156         }
157       ],
158       "return": {
159         "type": "String",
160         "doc": "<p>The formatted string</p>\n"
161       },
162       "private": false,
163       "static": false,
164       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
165       "linenr": 192,
166       "html_filename": "String.html",
167       "href": "String.html#Ext-String-method-format",
168       "shortDoc": "Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each\ntoken ..."
169     },
170     {
171       "tagname": "method",
172       "name": "htmlDecode",
173       "member": "Ext.String",
174       "doc": "<p>Convert certain characters (&amp;, &lt;, >, and ') from their HTML character equivalents.</p>\n",
175       "params": [
176         {
177           "type": "String",
178           "name": "value",
179           "doc": "<p>The string to decode</p>\n",
180           "optional": false
181         }
182       ],
183       "return": {
184         "type": "String",
185         "doc": "<p>The decoded text</p>\n"
186       },
187       "private": false,
188       "static": false,
189       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
190       "linenr": 41,
191       "html_filename": "String.html",
192       "href": "String.html#Ext-String-method-htmlDecode",
193       "shortDoc": "<p>Convert certain characters (&amp;, &lt;, >, and ') from their HTML character equivalents.</p>\n"
194     },
195     {
196       "tagname": "method",
197       "name": "htmlEncode",
198       "member": "Ext.String",
199       "doc": "<p>Convert certain characters (&amp;, &lt;, >, and ') to their HTML character equivalents for literal display in web pages.</p>\n",
200       "params": [
201         {
202           "type": "String",
203           "name": "value",
204           "doc": "<p>The string to encode</p>\n",
205           "optional": false
206         }
207       ],
208       "return": {
209         "type": "String",
210         "doc": "<p>The encoded text</p>\n"
211       },
212       "private": false,
213       "static": false,
214       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
215       "linenr": 14,
216       "html_filename": "String.html",
217       "href": "String.html#Ext-String-method-htmlEncode",
218       "shortDoc": "Convert certain characters (&amp;, &lt;, >, and ') to their HTML character equivalents for literal display in web pag..."
219     },
220     {
221       "tagname": "method",
222       "name": "leftPad",
223       "member": "Ext.String",
224       "doc": "<p>Pads the left side of a string with a specified character.  This is especially useful\nfor normalizing number and date strings.  Example usage:</p>\n\n<pre><code>var s = Ext.String.leftPad('123', 5, '0');\n// s now contains the string: '00123'\n       </code></pre>\n\n",
225       "params": [
226         {
227           "type": "String",
228           "name": "string",
229           "doc": "<p>The original string</p>\n",
230           "optional": false
231         },
232         {
233           "type": "Number",
234           "name": "size",
235           "doc": "<p>The total length of the output string</p>\n",
236           "optional": false
237         },
238         {
239           "type": "String",
240           "name": "character",
241           "doc": "<p>(optional) The character with which to pad the original string (defaults to empty string \" \")</p>\n",
242           "optional": true
243         }
244       ],
245       "return": {
246         "type": "String",
247         "doc": "<p>The padded string</p>\n"
248       },
249       "private": false,
250       "static": false,
251       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
252       "linenr": 170,
253       "html_filename": "String.html",
254       "href": "String.html#Ext-String-method-leftPad",
255       "shortDoc": "Pads the left side of a string with a specified character.  This is especially useful\nfor normalizing number and date..."
256     },
257     {
258       "tagname": "method",
259       "name": "toggle",
260       "member": "Ext.String",
261       "doc": "<p>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.</p>\n\n<pre><code>    // alternate sort directions\n    sort = Ext.String.toggle(sort, 'ASC', 'DESC');\n\n    // instead of conditional logic:\n    sort = (sort == 'ASC' ? 'DESC' : 'ASC');\n       </code></pre>\n\n",
262       "params": [
263         {
264           "type": "String",
265           "name": "string",
266           "doc": "<p>The current string</p>\n",
267           "optional": false
268         },
269         {
270           "type": "String",
271           "name": "value",
272           "doc": "<p>The value to compare to the current string</p>\n",
273           "optional": false
274         },
275         {
276           "type": "String",
277           "name": "other",
278           "doc": "<p>The new value to use if the string already equals the first value passed in</p>\n",
279           "optional": false
280         }
281       ],
282       "return": {
283         "type": "String",
284         "doc": "<p>The new value</p>\n"
285       },
286       "private": false,
287       "static": false,
288       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
289       "linenr": 149,
290       "html_filename": "String.html",
291       "href": "String.html#Ext-String-method-toggle",
292       "shortDoc": "Utility function that allows you to easily switch a string between two alternating values.  The passed value\nis compa..."
293     },
294     {
295       "tagname": "method",
296       "name": "trim",
297       "member": "Ext.String",
298       "doc": "<p>Trims whitespace from either end of a string, leaving spaces within the string intact.  Example:\n@example\nvar s = '  foo bar  ';\nalert('-' + s + '-');         //alerts \"- foo bar -\"\nalert('-' + Ext.String.trim(s) + '-');  //alerts \"-foo bar-\"</p>\n",
299       "params": [
300         {
301           "type": "String",
302           "name": "string",
303           "doc": "<p>The string to escape</p>\n",
304           "optional": false
305         }
306       ],
307       "return": {
308         "type": "String",
309         "doc": "<p>The trimmed string</p>\n"
310       },
311       "private": false,
312       "static": false,
313       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
314       "linenr": 87,
315       "html_filename": "String.html",
316       "href": "String.html#Ext-String-method-trim",
317       "shortDoc": "Trims whitespace from either end of a string, leaving spaces within the string intact.  Example:\n@example\nvar s = '  ..."
318     },
319     {
320       "tagname": "method",
321       "name": "urlAppend",
322       "member": "Ext.String",
323       "doc": "<p>Appends content to the query string of a URL, handling logic for whether to place\na question mark or ampersand.</p>\n",
324       "params": [
325         {
326           "type": "String",
327           "name": "url",
328           "doc": "<p>The URL to append to.</p>\n",
329           "optional": false
330         },
331         {
332           "type": "String",
333           "name": "string",
334           "doc": "<p>The content to append to the URL.</p>\n",
335           "optional": false
336         }
337       ],
338       "return": {
339         "type": "void",
340         "doc": "<p>(String) The resulting URL</p>\n"
341       },
342       "private": false,
343       "static": false,
344       "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
345       "linenr": 72,
346       "html_filename": "String.html",
347       "href": "String.html#Ext-String-method-urlAppend",
348       "shortDoc": "<p>Appends content to the query string of a URL, handling logic for whether to place\na question mark or ampersand.</p>\n"
349     }
350   ],
351   "property": [
352
353   ],
354   "event": [
355
356   ],
357   "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/lang/String.js",
358   "linenr": 1,
359   "html_filename": "String.html",
360   "href": "String.html#Ext-String",
361   "cssVar": [
362
363   ],
364   "cssMixin": [
365
366   ],
367   "component": false,
368   "superclasses": [
369
370   ],
371   "subclasses": [
372
373   ],
374   "mixedInto": [
375
376   ],
377   "allMixins": [
378
379   ]
380 });