| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 * combining accent character "◌́". | 98 * combining accent character "◌́". |
| 99 */ | 99 */ |
| 100 bool operator ==(var other); | 100 bool operator ==(var other); |
| 101 | 101 |
| 102 /** | 102 /** |
| 103 * Returns whether this string ends with [other]. | 103 * Returns whether this string ends with [other]. |
| 104 */ | 104 */ |
| 105 bool endsWith(String other); | 105 bool endsWith(String other); |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * Returns whether this string starts with [other]. | 108 * Returns whether this string starts with a match of [pattern]. |
| 109 */ | 109 */ |
| 110 bool startsWith(String other); | 110 bool startsWith(Pattern pattern); |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * Returns the first location of [other] in this string starting at | 113 * Returns the first position of a match of [pattern] in this string, |
| 114 * [start] (inclusive). | 114 * starting at [start] (inclusive). |
| 115 * Returns -1 if [other] could not be found. | 115 * |
| 116 * Returns -1 if a match could not be found. |
| 117 * |
| 118 * It is an error if start is negative or greater than [length]. |
| 116 */ | 119 */ |
| 117 int indexOf(String other, [int start]); | 120 int indexOf(Pattern pattern, [int start]); |
| 118 | 121 |
| 119 /** | 122 /** |
| 120 * Returns the last location of [other] in this string, searching | 123 * Returns the last position of a match [pattern] in this string, searching |
| 121 * backward starting at [start] (inclusive). | 124 * backward starting at [start] (inclusive). |
| 125 * |
| 122 * Returns -1 if [other] could not be found. | 126 * Returns -1 if [other] could not be found. |
| 127 * |
| 128 * It is an error if start is negative or greater than [length]. |
| 123 */ | 129 */ |
| 124 int lastIndexOf(String other, [int start]); | 130 int lastIndexOf(Pattern pattern, [int start]); |
| 125 | 131 |
| 126 /** | 132 /** |
| 127 * Returns whether this string is empty. | 133 * Returns whether this string is empty. |
| 128 */ | 134 */ |
| 129 bool get isEmpty; | 135 bool get isEmpty; |
| 130 | 136 |
| 131 /** | 137 /** |
| 132 * Returns whether this string is not empty. | 138 * Returns whether this string is not empty. |
| 133 */ | 139 */ |
| 134 bool get isNotEmpty; | 140 bool get isNotEmpty; |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 _position = position - 1; | 472 _position = position - 1; |
| 467 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 473 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
| 468 return true; | 474 return true; |
| 469 } | 475 } |
| 470 } | 476 } |
| 471 _position = position; | 477 _position = position; |
| 472 _currentCodePoint = codeUnit; | 478 _currentCodePoint = codeUnit; |
| 473 return true; | 479 return true; |
| 474 } | 480 } |
| 475 } | 481 } |
| OLD | NEW |