|
|
@ -60,12 +60,14 @@ fun String.splitNotBlank(regex: Regex, limit: Int = 0): Array<String> = run { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun String.toStringArray(): Array<String> { |
|
|
|
fun String.toStringArray(): Array<String> { |
|
|
|
var codePointIndex = 0 |
|
|
|
var codePointIndex = 0 |
|
|
|
return Array(codePointCount(0, length)) { |
|
|
|
return try { |
|
|
|
substring( |
|
|
|
Array(codePointCount(0, length)) { |
|
|
|
codePointIndex, |
|
|
|
val start = codePointIndex |
|
|
|
offsetByCodePoints(codePointIndex, 1) |
|
|
|
codePointIndex = offsetByCodePoints(start, 1) |
|
|
|
.apply { codePointIndex = this } |
|
|
|
substring(start, codePointIndex) |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
split("").toTypedArray() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|