jw
07/26/2016, 9:07 PMjw
07/26/2016, 9:08 PMyougin
07/26/2016, 9:08 PMartem_zin
07/26/2016, 9:08 PMyougin
07/26/2016, 9:12 PMjw
07/26/2016, 9:17 PMjw
07/26/2016, 9:18 PMartem_zin
07/26/2016, 9:18 PMmap
to Any
, so I could write:
string.filter { it.isDigit() }.length.map { it >= min && it <= max }
jw
07/26/2016, 9:19 PMuse { }
jw
07/26/2016, 9:19 PMlet
?jw
07/26/2016, 9:19 PMjw
07/26/2016, 9:19 PMrun
?artem_zin
07/26/2016, 9:19 PMjw
07/26/2016, 9:19 PMjw
07/26/2016, 9:19 PMlet
jw
07/26/2016, 9:20 PMartem_zin
07/26/2016, 9:20 PMartem_zin
07/26/2016, 9:21 PMstring.filter { it.isDigit() }.length.let { it >= min && it <= max }
yougin
07/26/2016, 9:22 PMartem_zin
07/26/2016, 9:22 PMartem_zin
07/26/2016, 9:22 PMjw
07/26/2016, 9:23 PMint count = 0;
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
if (Character.isDigit(c) && c >= min && c <= max) {
count++;
}
}
return count;
yougin
07/26/2016, 9:23 PMjw
07/26/2016, 9:24 PMjw
07/26/2016, 9:24 PMjw
07/26/2016, 9:24 PMyougin
07/26/2016, 9:24 PMartem_zin
07/26/2016, 9:25 PMdasralph
07/29/2016, 9:52 AMfun <T> observable(body : (s : Subscriber<in T>) -> Unit) : Observable<T> = Observable.create(body)
. Why is s
from type Subscriber<in T>
?.
Observable.create
wants a OnSubscribe<T>
and OnSubscribe
extends Action1<Subscriber<? super T>>
. So why is s
from type Subscriber<in T>
and not from type Action1<Subscriber<in T>>
?