@DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2013-12-30 13:00:42.074 -0500", hash_original_method = "002C3CFFC816A38E005543BB54E228FD", hash_generated_method = "24D6A751F50FC61EC42FBA4D0FC608F4" ) fun toLowerCase(string: String): String? { var changed = false val chars = string.toCharArray() for (i in chars.indices) { val ch = chars[i] if ('A' <= ch && 'Z' >= ch) { changed = true chars[i] = (ch.code - 'A'.code + 'a'.code).toChar() } } return if (changed) { String(chars) } else string }
A locale independent version of toLowerCase .