kirillrakhman
04/18/2016, 7:23 PMuhe
04/18/2016, 7:26 PMorangy
File.existingOrNull
is way too wrong simple smile File system is async in nature, so such function doesn’t make any sensekirillrakhman
04/18/2016, 7:37 PMorangy
orangy
withFileOrNull(fileName) { file-> … }
and then catch exception in the function. 🤔 Not sure…kirillrakhman
04/18/2016, 11:43 PMdimsuz
05/04/2016, 5:51 PMcount: Int
and for count = 5
I want to create a string "(?,?,?,?,?)"
vmironov
05/04/2016, 5:52 PMArray(count, { "?" }).joinToString(",", "(", ")”)
orangy
"(${"?,".repeat(count - 1)}?)"
dimsuz
05/04/2016, 5:54 PMgenerate
, forgot about repeat
ilya.gorbunov
05/04/2016, 5:58 PM"?".repeat(count).asIterable().joinToString(",", "(", ")")
dimsuz
05/04/2016, 5:59 PMasIterable()
) simple smile but depends on context of course...orangy
StringBuilder
and use it to build a string. And use loop instead of iterable.sreich
05/04/2016, 6:51 PMloganj
05/05/2016, 2:43 PMdimsuz
05/05/2016, 2:45 PMdean
05/05/2016, 2:54 PMinline operator fun get(range: IntRange): String = substring(range)
evanchooly
05/05/2016, 3:12 PMsreich
05/05/2016, 3:15 PMsreich
05/05/2016, 3:16 PMsreich
05/05/2016, 3:16 PMevanchooly
05/05/2016, 3:16 PMevanchooly
05/05/2016, 3:18 PMvoddan
05/05/2016, 4:23 PM"stuff".slice(0..4)
It was decided not to use an operator because of its obscurity (remember that first time you googled "what the hell does 15-1 mean in python" ).sreich
05/05/2016, 5:13 PMdean
05/05/2016, 6:59 PMsreich
05/05/2016, 7:00 PMsreich
05/05/2016, 7:01 PMsreich
05/05/2016, 7:01 PM