contentEquals

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

Since Kotlin

1.5

Samples


expect fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean(source)

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

Since Kotlin

1.5

Parameters

ignoreCase

true to ignore character case when comparing contents.

Samples

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

Since Kotlin

1.5

Samples


actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean(source)

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

Since Kotlin

1.5

Parameters

ignoreCase

true to ignore character case when comparing contents.

Samples

inline fun String.contentEquals(charSequence: CharSequence): Boolean(source)

Returns true if this string is equal to the contents of the specified CharSequence, false otherwise.

Note that if the CharSequence argument is a StringBuffer then the comparison may be performed in a synchronized block that acquires that StringBuffer's monitor.

Since Kotlin

1.0

inline fun String.contentEquals(stringBuilder: StringBuffer): Boolean(source)

Returns true if this string is equal to the contents of the specified StringBuffer, false otherwise.

This function compares this string and the specified StringBuffer in a synchronized block that acquires that StringBuffer's monitor.

Since Kotlin

1.0

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

If this CharSequence is a String and other is not null then this function behaves the same as String.contentEquals.

Since Kotlin

1.5

Samples


actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean(source)

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

If this CharSequence is a String, other is not null and ignoreCase is false then this function behaves the same as String.contentEquals.

Since Kotlin

1.5

Parameters

ignoreCase

true to ignore character case when comparing contents.

Samples

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

Since Kotlin

1.5

Samples


actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean(source)

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

Since Kotlin

1.5

Parameters

ignoreCase

true to ignore character case when comparing contents.

Samples

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

Since Kotlin

1.8

Samples


actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean(source)

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

Since Kotlin

1.8

Parameters

ignoreCase

true to ignore character case when comparing contents.

Samples

Returns true if the contents of this char sequence are equal to the contents of the specified other, i.e. both char sequences contain the same number of the same characters in the same order.

Since Kotlin

1.8

Samples


actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean(source)

Returns true if the contents of this char sequence are equal to the contents of the specified other, optionally ignoring case difference.

Since Kotlin

1.8

Parameters

ignoreCase

true to ignore character case when comparing contents.

Samples