Chromium Code Reviews| Index: sdk/lib/core/string.dart |
| diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart |
| index ebc6c20700299974fe4fd4336bce9b203114e2ac..0ec07c7afd3a894e6da327f688e274cbe80301c8 100644 |
| --- a/sdk/lib/core/string.dart |
| +++ b/sdk/lib/core/string.dart |
| @@ -409,11 +409,12 @@ abstract class String implements Comparable<String>, Pattern { |
| /** |
| * Returns a new string in which the first occurence of [from] in this string |
| - * is replaced with [to]: |
| + * is replaced with [to], optionally starting at [startIndex]: |
|
Lasse Reichstein Nielsen
2014/08/19 07:26:45
Not optionally. It always starts at startIndex, so
srawlins
2014/08/19 21:42:32
Done.
|
| * |
| * '0.0001'.replaceFirst(new RegExp(r'0'), ''); // '.0001' |
| + * '0.0001'.replaceFirst(new RegExp(r'0'), '7', 1); // '0.7001' |
| */ |
| - String replaceFirst(Pattern from, String to); |
| + String replaceFirst(Pattern from, String to, [int startIndex = 0]); |
| /** |
| * Replaces all substrings that match [from] with [replace]. |