Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: sdk/lib/core/string.dart

Issue 949753005: Add String.replaceRange and use it in replaceFirst{,Mapped}. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/string_helper.dart ('k') | tests/corelib/string_replace_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/string.dart
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index 625446fb8df99ec859c2052dbd6f32b0138ebb1b..c92ca9f50e8bf33eedf7fb9a597bc68e8cde9416 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -477,6 +477,19 @@ abstract class String implements Comparable<String>, Pattern {
String replaceAllMapped(Pattern from, String replace(Match match));
/**
+ * Replaces the substring from [start] to [end] with [replacement].
+ *
+ * Returns a new string equivalent to:
+ *
+ * this.substring(0, start) + replacement + this.substring(end)
+ *
+ * The [start] and [end] indices must specify a valid range of this string.
+ * That is `0 <= start <= end <= this.length`.
+ * If [end] is `null`, it defaults to [length].
+ */
+ String replaceRange(int start, int end, String replacement);
+
+ /**
* Splits the string at matches of [pattern] and returns a list of substrings.
*
* Finds all the matches of `pattern` in this string,
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/string_helper.dart ('k') | tests/corelib/string_replace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698