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

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

Issue 17281002: Make String.startsWith take an optional start index. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 0d2503a8e2c89dacaabd1d681dc69b4121432871..3524139e7e44c0cd19798038fa83ccecad422e18 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -106,8 +106,13 @@ abstract class String implements Comparable<String>, Pattern {
/**
* Returns whether this string starts with a match of [pattern].
+ *
+ * If [index] is provided, instead check if the substring starting
floitsch 2013/06/17 16:07:15 If [index] is provided, checks if `this` starts wi
+ * at that index starts with [pattern].
+ *
+ * It is an error if [index] is negative or greater than [length].
*/
- bool startsWith(Pattern pattern);
+ bool startsWith(Pattern pattern, [int index = 0]);
/**
* Returns the first position of a match of [pattern] in this string,

Powered by Google App Engine
This is Rietveld 408576698