thanh
04/01/2016, 10:05 AMnizajakub
04/01/2016, 10:20 AMdmitry.petrov
04/01/2016, 10:22 AMCollection<T>.drop
will copy corresponding elements to a new ArrayList
.nizajakub
04/01/2016, 10:34 AMthanh
04/01/2016, 10:39 AMthanh
04/01/2016, 10:39 AMthanh
04/01/2016, 10:42 AM0 -> sb.append(“")
nizajakub
04/01/2016, 10:42 AMthanh
04/01/2016, 10:43 AMdrop
?thanh
04/01/2016, 10:44 AMtakeLast
but it’s seem to be removednizajakub
04/01/2016, 10:45 AMorangy
fun joinList(collection: List<String>): String = StringBuilder().apply {
append("{")
collection.forEachIndexed { index, item -> append(", ", 0, index.coerceAtMost(1) * 2).append(item) }
append("}")
}.toString()
cole
04/01/2016, 6:24 PMcole
04/01/2016, 6:25 PMyole
04/01/2016, 6:28 PMyole
04/01/2016, 6:28 PMoverride fun equals(other: Any?)
yole
04/01/2016, 6:29 PM==
will call itcole
04/01/2016, 6:30 PMAny?
.cleiter
04/01/2016, 7:15 PMcleiter
04/01/2016, 7:16 PMyole
04/01/2016, 7:25 PMcleiter
04/01/2016, 7:26 PMcleiter
04/01/2016, 7:27 PMoverloadedMethod(foo as TypeHint)
?yole
04/01/2016, 7:30 PMyole
04/01/2016, 7:30 PMcleiter
04/01/2016, 7:31 PMvint
04/02/2016, 2:47 PMenum class Currency(val sign: String) {
USD("$"),
GBP("£"),
THB("฿")
}
I can use it by
val currency = Currency.USD
println(currency.sign) // print '$'
But what if I want to have a custom enum, how to create something like Currency.customSign("*")
surya
04/02/2016, 2:56 PMpublic static final
in javamatej
04/02/2016, 2:59 PMvint
04/02/2016, 3:00 PM