Index: runtime/lib/string.dart |
=================================================================== |
--- runtime/lib/string.dart (revision 942) |
+++ runtime/lib/string.dart (working copy) |
@@ -103,7 +103,7 @@ |
return this.substringMatches(0, other); |
} |
- int indexOf(String other, int startIndex) { |
+ int indexOf(String other, [int startIndex = 0]) { |
if (other.isEmpty()) { |
return startIndex < this.length ? startIndex : this.length; |
} |
@@ -119,7 +119,8 @@ |
return -1; |
} |
- int lastIndexOf(String other, int fromIndex) { |
+ int lastIndexOf(String other, [int fromIndex = null]) { |
+ if (fromIndex == null) fromIndex = length - 1; |
if (other.isEmpty()) { |
return Math.min(this.length, fromIndex); |
} |