Fix String.dropWhile & String.takeWhile
This commit is contained in:
committed by
Andrey Breslav
parent
5b73fba2d4
commit
a2a93a3830
@@ -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
|
||||
"""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user