Fix String.dropWhile & String.takeWhile

This commit is contained in:
Ilya Ryzhenkov
2014-05-28 15:50:15 +04:00
committed by Andrey Breslav
parent 5b73fba2d4
commit a2a93a3830
3 changed files with 12 additions and 10 deletions
@@ -113,7 +113,7 @@ fun filtering(): List<GenericFunction> {
returns(Strings) { "String" }
body(Strings) {
"""
for (index in 0..length)
for (index in 0..length - 1)
if (!predicate(get(index))) {
return substring(index)
}
@@ -161,11 +161,11 @@ fun filtering(): List<GenericFunction> {
returns(Strings) { "String" }
body(Strings) {
"""
for (index in 0..length)
for (index in 0..length - 1)
if (!predicate(get(index))) {
return substring(0, index)
}
return ""
return this
"""
}