maxWith

@JvmName(name = "maxWithOrThrow")
fun CharSequence.maxWith(comparator: Comparator<in Char>): Char(source)

Returns the first character having the largest value according to the provided comparator.

Since Kotlin

1.7

Throws

if the char sequence is empty.

fun CharSequence.maxWith(comparator: Comparator<in Char>): Char?(source)

Deprecated

Warning since 1.4

Error since 1.5

Hidden since 1.6

Use maxWithOrNull instead.

Replace with

this.maxWithOrNull(comparator)

Since Kotlin

1.0