| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 * If this string is not already all upper case, returns a new string | 244 * If this string is not already all upper case, returns a new string |
| 245 * where all characters are made upper case. Returns [:this:] otherwise. | 245 * where all characters are made upper case. Returns [:this:] otherwise. |
| 246 */ | 246 */ |
| 247 // TODO(floitsch): document better. (See EcmaScript for description). | 247 // TODO(floitsch): document better. (See EcmaScript for description). |
| 248 String toUpperCase(); | 248 String toUpperCase(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 /** | 251 /** |
| 252 * The runes (integer Unicode code points) of a [String]. | 252 * The runes (integer Unicode code points) of a [String]. |
| 253 */ | 253 */ |
| 254 class Runes extends Iterable<int> { | 254 class Runes extends IterableBase<int> { |
| 255 final String string; | 255 final String string; |
| 256 Runes(this.string); | 256 Runes(this.string); |
| 257 | 257 |
| 258 RuneIterator get iterator => new RuneIterator(string); | 258 RuneIterator get iterator => new RuneIterator(string); |
| 259 | 259 |
| 260 int get last { | 260 int get last { |
| 261 if (string.length == 0) { | 261 if (string.length == 0) { |
| 262 throw new StateError("No elements."); | 262 throw new StateError("No elements."); |
| 263 } | 263 } |
| 264 int length = string.length; | 264 int length = string.length; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 _position = position - 1; | 439 _position = position - 1; |
| 440 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 440 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
| 441 return true; | 441 return true; |
| 442 } | 442 } |
| 443 } | 443 } |
| 444 _position = position; | 444 _position = position; |
| 445 _currentCodePoint = codeUnit; | 445 _currentCodePoint = codeUnit; |
| 446 return true; | 446 return true; |
| 447 } | 447 } |
| 448 } | 448 } |
| OLD | NEW |