| 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 |
| 11 * [codeUnits] members. Their string representation is accessible through | 11 * [codeUnits] members. Their string representation is accessible through |
| 12 * the index-operator. | 12 * the index-operator. |
| 13 * | 13 * |
| 14 * The characters of a string are encoded in UTF-16. Decoding UTF-16, which | 14 * The characters of a string are encoded in UTF-16. Decoding UTF-16, which |
| 15 * combines surrogate pairs, yields Unicode code points. Following a similar | 15 * combines surrogate pairs, yields Unicode code points. Following a similar |
| 16 * terminology to Go we use the name "rune" for an integer representing a | 16 * terminology to Go we use the name "rune" for an integer representing a |
| 17 * Unicode code point. The runes of a string are accessible through the [runes] | 17 * Unicode code point. The runes of a string are accessible through the [runes] |
| 18 * getter. | 18 * getter. |
| 19 * |
| 20 * It is a compile-time error for a class to attempt to extend or implement |
| 21 * String. |
| 19 */ | 22 */ |
| 20 abstract class String implements Comparable<String>, Pattern { | 23 abstract class String implements Comparable<String>, Pattern { |
| 21 /** | 24 /** |
| 22 * Allocates a new String for the specified [charCodes]. | 25 * Allocates a new String for the specified [charCodes]. |
| 23 * | 26 * |
| 24 * The [charCodes] can be UTF-16 code units or runes. If a char-code value is | 27 * The [charCodes] can be UTF-16 code units or runes. If a char-code value is |
| 25 * 16-bit it is copied verbatim. If it is greater than 16 bits it is | 28 * 16-bit it is copied verbatim. If it is greater than 16 bits it is |
| 26 * decomposed into a surrogate pair. | 29 * decomposed into a surrogate pair. |
| 27 */ | 30 */ |
| 28 external factory String.fromCharCodes(Iterable<int> charCodes); | 31 external factory String.fromCharCodes(Iterable<int> charCodes); |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 _position = position - 1; | 485 _position = position - 1; |
| 483 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 486 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
| 484 return true; | 487 return true; |
| 485 } | 488 } |
| 486 } | 489 } |
| 487 _position = position; | 490 _position = position; |
| 488 _currentCodePoint = codeUnit; | 491 _currentCodePoint = codeUnit; |
| 489 return true; | 492 return true; |
| 490 } | 493 } |
| 491 } | 494 } |
| OLD | NEW |