String

expect fun String(chars: CharArray): String(source)

Deprecated

Warning since 1.4

Error since 1.5

Use CharArray.concatToString() instead

Replace with

chars.concatToString()

Converts the characters in the specified array to a string.

Since Kotlin

1.2

expect fun String(chars: CharArray, offset: Int, length: Int): String(source)

Deprecated

Warning since 1.4

Error since 1.5

Use CharArray.concatToString(startIndex, endIndex) instead

Replace with

chars.concatToString(offset, offset + length)

Converts the characters from a portion of the specified array to a string.

Since Kotlin

1.2

Throws

if either offset or length are less than zero or offset + length is out of chars array bounds.

actual fun String(chars: CharArray): String(source)

Deprecated

Warning since 1.4

Error since 1.5

Use CharArray.concatToString() instead

Replace with

chars.concatToString()

Converts the characters in the specified array to a string.

Since Kotlin

1.2

actual fun String(chars: CharArray, offset: Int, length: Int): String(source)

Deprecated

Warning since 1.4

Error since 1.5

Use CharArray.concatToString(startIndex, endIndex) instead

Replace with

chars.concatToString(offset, offset + length)

Converts the characters from a portion of the specified array to a string.

Since Kotlin

1.2

Throws

if either offset or length are less than zero or offset + length is out of chars array bounds.

inline fun String(bytes: ByteArray, offset: Int, length: Int, charset: Charset): String(source)

Converts the data from a portion of the specified array of bytes to characters using the specified character set and returns the conversion result as a string.

Since Kotlin

1.0

Parameters

bytes

the source array for the conversion.

offset

the offset in the array of the data to be converted.

length

the number of bytes to be converted.

charset

the character set to use.


inline fun String(bytes: ByteArray, charset: Charset): String(source)

Converts the data from the specified array of bytes to characters using the specified character set and returns the conversion result as a string.

Since Kotlin

1.0

inline fun String(bytes: ByteArray, offset: Int, length: Int): String(source)

Converts the data from a portion of the specified array of bytes to characters using the UTF-8 character set and returns the conversion result as a string.

Since Kotlin

1.0

Parameters

bytes

the source array for the conversion.

offset

the offset in the array of the data to be converted.

length

the number of bytes to be converted.


inline fun String(bytes: ByteArray): String(source)

Converts the data from the specified array of bytes to characters using the UTF-8 character set and returns the conversion result as a string.

Since Kotlin

1.0

inline fun String(codePoints: IntArray, offset: Int, length: Int): String(source)

Converts the code points from a portion of the specified Unicode code point array to a string.

Since Kotlin

1.0

inline fun String(stringBuffer: StringBuffer): String(source)

Converts the contents of the specified StringBuffer to a string.

Since Kotlin

1.0

inline fun String(stringBuilder: StringBuilder): String(source)

Converts the contents of the specified StringBuilder to a string.

Since Kotlin

1.0

actual inline fun String(chars: CharArray): String(source)

Converts the characters in the specified array to a string.

Since Kotlin

1.0

actual inline fun String(chars: CharArray, offset: Int, length: Int): String(source)

Converts the characters from a portion of the specified array to a string.

Since Kotlin

1.0

Throws

if either offset or length are less than zero or offset + length is out of chars array bounds.

actual fun String(chars: CharArray): String(source)

Deprecated

Warning since 1.4

Error since 1.5

Use CharArray.concatToString() instead

Replace with

chars.concatToString()

Converts the characters in the specified array to a string.

Since Kotlin

1.3

actual fun String(chars: CharArray, offset: Int, length: Int): String(source)

Deprecated

Warning since 1.4

Error since 1.5

Use CharArray.concatToString(startIndex, endIndex) instead

Replace with

chars.concatToString(offset, offset + length)

Converts the characters from a portion of the specified array to a string.

Since Kotlin

1.3

Throws

if either offset or length are less than zero or offset + length is out of chars array bounds.