← Docs
kotlin-stdlib / kotlin.text / max

max

Common
JS
Native
1.7
@JvmName ( "maxOrThrow" ) fun CharSequence . max ( ) : Char
(source)
JVM
1.0
@DeprecatedSinceKotlin ( "1.4" , "1.5" , "1.6" ) fun CharSequence . max ( ) : Char ?
(source)
Deprecated: Use maxOrNull instead.

Returns the largest character.

Exceptions

NoSuchElementException - if the char sequence is empty.

Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .