/** Gets the second character in a string or, if not possible, returns some default value (which may be `null`) */ fun getSecondCharOrDefault(str: String, defaultVal: String?) = if(str.length > 2) str[1] else defaultVal