String

fun String(bytes: ByteArray, offset: Int = 0, length: Int = bytes.size, charset: Charset = Charsets.UTF_8): String

Deprecated

Use decodeToString instead

Replace with

bytes.decodeToString(offset, offset + length)

Create an instance of String from the specified bytes range starting at offset and bytes length interpreting characters in the specified charset.