getOrNull
Returns the substring from the given range if exist otherwise return a null.
Example:
"Hello".getOrNull(1..3) // ell
"Hello".getOrNull(1..5) // null
Content copied to clipboard
Since
1.1.0
See also
substring
IntRange
Returns the substring from the given progression if exist otherwise return a null.
Example:
"Hello".getOrNull(0..4 step 2) // Hlo
"Hello".getOrNull(0..8 step 2) // null
Content copied to clipboard
Since
1.1.0
See also
substring
IntProgression