Using the Elvis operator to deal with null values. fun strLenSafe(s: String?): Int = s?.length ?: 0 >>> println(strLenSafe("abc")) ...
確定! 回上一頁