InPlaceCharSequence

Properties

Link copied to clipboard
open override val length: Int

Returns the size of this subSequence.

Functions

Link copied to clipboard
inline fun CharSequence.countWords(wordSeparator: (Char) -> Boolean = { it == ' ' }): Int

Returns the number of words in the string without creating intermediate objects.

Link copied to clipboard
inline fun CharSequence.forEachSplit(delimiter: Char, action: (segment: CharSequence) -> Unit)

Executes the given action for each segment of the CharSequence split by the delimiter. This function avoids creating intermediate collections, making it more memory-efficient for large strings or frequent calls compared to String.split().forEach().

Link copied to clipboard
open operator override fun get(index: Int): Char

Returns the element at the specified index in this subSequence.

Link copied to clipboard
open override fun subSequence(startIndex: Int, endIndex: Int): CharSequence

Returns a new InPlaceCharSequence that is a subsequence of this character sequence, starting at the specified startIndex and ending right before the specified endIndex.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of this in-place subsequence.