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

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

Issue 515183002: Make String.fromCharCodes take start/end. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't say that end must be greater than start. Passing the actual length should be the same as pass… Created 6 years, 4 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
Index: sdk/lib/core/string.dart
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index 384b183c0b50af170b709dedb18605cc4e5eede3..9813ad0569c4f41ae957ac23930a9f1370fd5eb5 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -105,8 +105,17 @@ abstract class String implements Comparable<String>, Pattern {
* var clef = new String.fromCharCodes([0x1D11E]);
* clef.codeUnitAt(0); // 0xD834
* clef.codeUnitAt(1); // 0xDD1E
+ *
+ * If [start] is provided, the first `start` elements of `charCodes` are
+ * skipped. If `charCodes` has fewer than `start` elements in all, the
+ * result is an empty string. The `start` value must be non-negative.
+ *
+ * If [end] is provided, any elements of `charCodes` after the `end`'th are
+ * ignored. If `charCodes` has fewer than `end` elements, the `end` parameter
+ * has no effect.
*/
- external factory String.fromCharCodes(Iterable<int> charCodes);
+ external factory String.fromCharCodes(Iterable<int> charCodes,
+ [int start = 0, int end]);
srdjan 2014/09/17 15:31:59 I assume the library team has agreed to this API c
/**
* Allocates a new String for the specified [charCode].

Powered by Google App Engine
This is Rietveld 408576698