getOrEmpty
Returns an element at the given index or empty if the index is out of bounds of this string Array.
Example:
val list = arrayOf(1..5)
list.getOrEmpty(8) // ""
list[2] // 3
Content copied to clipboard
Since
1.1.0
See also
Returns an element at the given index or empty if the index is out of bounds of this string Collection.
Example:
val list = listOf(1..5)
list.getOrEmpty(8) // ""
list[2] // 3
Content copied to clipboard
Since
1.1.0