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

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: Merge to tip of tree. Created 6 years, 3 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/convert/utf.dart ('k') | sdk/lib/internal/iterable.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 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.
sra1 2014/09/25 19:58:24 Most APIs with a start and end are strict, requiri
Lasse Reichstein Nielsen 2014/09/25 20:01:08 It is deliberate because the input is an iterable,
floitsch 2014/09/25 20:08:46 I agree with Stephen: start, end should have the s
*/
- external factory String.fromCharCodes(Iterable<int> charCodes);
+ external factory String.fromCharCodes(Iterable<int> charCodes,
+ [int start = 0, int end]);
/**
* Allocates a new String for the specified [charCode].
« no previous file with comments | « sdk/lib/convert/utf.dart ('k') | sdk/lib/internal/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698