Skip to content

Instantly share code, notes, and snippets.

View sajjadyousefnia's full-sized avatar
🤒
Out sick

Sajjad Yousefnia sajjadyousefnia

🤒
Out sick
View GitHub Profile
private val clickSubject = PublishSubject.create<String>()
val oneToFive = 1..5
for (n in oneToFive) {
print(n)
}
for (n in 1..5) {
print(n)
}
val aToZ = "a".."z"
val oneToFive: IntRange = 1.rangeTo(5)
val fiveToOne = 5.downTo(1)
val oneToTenStep = 1..10 step 2 // 1, 3, 5, 7, 9
if (5 in 1..10) {
print("Yes 5 is in the range") // prints "Yes 5 is in the range"
}
public interface Collection<out E> : Iterable<E> {
public val size: Int
public fun isEmpty(): Boolean
public operator fun contains(element: @UnsafeVariance E): Boolean
override fun iterator(): Iterator<E>
public fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean
}