codePointBefore

Returns the Unicode code point preceding the specified index in this string.

The index refers to the char-based position in the string, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the string following the Unicode code point that is to be returned, must be in range 1..length.

Throws

if index is out of range.


Returns the Unicode code point preceding the specified index in this char sequence.

The index refers to the char-based position in the char sequence, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the char sequence following the Unicode code point that is to be returned, must be in range 1..length.

Throws

if index is out of range.


Returns the Unicode code point preceding the specified index in this char array.

The index refers to the char-based position in the char array, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the char array following the Unicode code point that is to be returned, must be in range 1..size.

Throws

if index is out of range.


Returns the Unicode code point preceding the specified index in this char array.

The index refers to the char-based position in the char array, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

The startIndex limits the beginning of a subrange in the char array, so that only characters at indices greater than or equal to startIndex are considered.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the char array following the Unicode code point that is to be returned, must be in range startIndex+1..size.

startIndex

the char-based position in the char array that limits the beginning of a subrange in the char array, must be in range 0..size.

Throws

Returns the Unicode code point preceding the specified index in this string.

The index refers to the char-based position in the string, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the string following the Unicode code point that is to be returned, must be in range 1..length.

Throws

if index is out of range.


Returns the Unicode code point preceding the specified index in this char sequence.

The index refers to the char-based position in the char sequence, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the char sequence following the Unicode code point that is to be returned, must be in range 1..length.

Throws

if index is out of range.


Returns the Unicode code point preceding the specified index in this char array.

The index refers to the char-based position in the char array, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the char array following the Unicode code point that is to be returned, must be in range 1..size.

Throws

if index is out of range.


actual inline fun CharArray.codePointBefore(index: Int, startIndex: Int): CodePoint(source)

Returns the Unicode code point preceding the specified index in this char array.

The index refers to the char-based position in the char array, and the returned value is the code point represented by the character or surrogate pair (a high surrogate char followed by a low surrogate char) immediately preceding that position.

If the index-1 position points to an unpaired surrogate character, for example, a low surrogate char not preceded by a high surrogate char, the code point with the code of that only one character is returned.

The startIndex limits the beginning of a subrange in the char array, so that only characters at indices greater than or equal to startIndex are considered.

Since Kotlin

2.5

Return

the Unicode code point value preceding the specified index.

Parameters

index

the char-based position in the char array following the Unicode code point that is to be returned, must be in range startIndex+1..size.

startIndex

the char-based position in the char array that limits the beginning of a subrange in the char array, must be in range 0..size.

Throws