OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.core; | 5 part of dart.core; |
6 | 6 |
7 /** | 7 /** |
8 * The String class represents sequences of characters. Strings are | 8 * The String class represents sequences of characters. Strings are |
9 * immutable. A string is represented by a sequence of Unicode UTF-16 | 9 * immutable. A string is represented by a sequence of Unicode UTF-16 |
10 * code units accessible through the [codeUnitAt] or the | 10 * code units accessible through the [codeUnitAt] or the |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 */ | 138 */ |
139 String operator +(String other); | 139 String operator +(String other); |
140 | 140 |
141 /** | 141 /** |
142 * Returns a substring of this string in the given range. | 142 * Returns a substring of this string in the given range. |
143 * [startIndex] is inclusive and [endIndex] is exclusive. | 143 * [startIndex] is inclusive and [endIndex] is exclusive. |
144 */ | 144 */ |
145 String substring(int startIndex, [int endIndex]); | 145 String substring(int startIndex, [int endIndex]); |
146 | 146 |
147 /** | 147 /** |
148 * Removes leading and trailing whitespace from a string. If the string | 148 * Removes leading and trailing whitespace from a string. |
149 * contains leading or trailing whitespace a new string with no leading and | 149 * |
150 * no trailing whitespace is returned. Otherwise, the string itself is | 150 * If the string contains leading or trailing whitespace a new string with no |
151 * returned. Whitespace is defined as every Unicode character in the Zs, Zl | 151 * leading and no trailing whitespace is returned. Otherwise, the string |
152 * and Zp categories (this includes no-break space), the spacing control | 152 * itself is returned. |
153 * characters from 9 to 13 (tab, lf, vtab, ff and cr), and 0xfeff the BOM | 153 * |
154 * character. | 154 * Whitespace is defined by the Unicode White_Space property (as defined in |
| 155 * version 6.2 or later) and the BOM character, 0xFEFF. |
| 156 * |
| 157 * Here is the list of trimmed characters (following version 6.2): |
| 158 * |
| 159 * 0009..000D ; White_Space # Cc <control-0009>..<control-000D> |
| 160 * 0020 ; White_Space # Zs SPACE |
| 161 * 0085 ; White_Space # Cc <control-0085> |
| 162 * 00A0 ; White_Space # Zs NO-BREAK SPACE |
| 163 * 1680 ; White_Space # Zs OGHAM SPACE MARK |
| 164 * 180E ; White_Space # Zs MONGOLIAN VOWEL SEPARATOR |
| 165 * 2000..200A ; White_Space # Zs EN QUAD..HAIR SPACE |
| 166 * 2028 ; White_Space # Zl LINE SEPARATOR |
| 167 * 2029 ; White_Space # Zp PARAGRAPH SEPARATOR |
| 168 * 202F ; White_Space # Zs NARROW NO-BREAK SPACE |
| 169 * 205F ; White_Space # Zs MEDIUM MATHEMATICAL SPACE |
| 170 * 3000 ; White_Space # Zs IDEOGRAPHIC SPACE |
| 171 * |
| 172 * FEFF ; BOM ZERO WIDTH NO_BREAK SPACE |
155 */ | 173 */ |
156 String trim(); | 174 String trim(); |
157 | 175 |
158 /** | 176 /** |
159 * Returns whether this string contains [other] starting | 177 * Returns whether this string contains [other] starting |
160 * at [startIndex] (inclusive). | 178 * at [startIndex] (inclusive). |
161 */ | 179 */ |
162 bool contains(Pattern other, [int startIndex]); | 180 bool contains(Pattern other, [int startIndex]); |
163 | 181 |
164 /** | 182 /** |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 _position = position - 1; | 457 _position = position - 1; |
440 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 458 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
441 return true; | 459 return true; |
442 } | 460 } |
443 } | 461 } |
444 _position = position; | 462 _position = position; |
445 _currentCodePoint = codeUnit; | 463 _currentCodePoint = codeUnit; |
446 return true; | 464 return true; |
447 } | 465 } |
448 } | 466 } |
OLD | NEW |