The contains function

The contains function is used to check whether a range contains a specific element:

if(evenRange.contains(2)) {
println("Found")
}

if(oddRange.contains(3)) {
println("Found")
}

This code checks whether the range of even numbers contains the element 2 and whether the range of odd numbers contains the element 3

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.234.188