Skip to content

Commit

Permalink
Support String factory functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmat192 authored and PavelPunegov committed Jun 13, 2018
1 parent 0e2fa56 commit 5cde399
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions runtime/src/main/kotlin/kotlin/text/Strings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,14 @@ public actual fun CharSequence.repeat(n: Int): String {
}
}
}

/**
* Converts the characters in the specified array to a string.
*/
// external fun fromCharArray(array: CharArray, start: Int, size: Int) : String
public actual fun String(chars: CharArray): String = fromCharArray(chars, 0, chars.size)

/**
* Converts the characters from a portion of the specified array to a string.
*/
public actual fun String(chars: CharArray, offset: Int, length: Int): String = fromCharArray(chars, offset, length)

0 comments on commit 5cde399

Please sign in to comment.