Deprecate String.toCharList to use toList instead.

This commit is contained in:
Ilya Gorbunov
2015-11-21 08:26:25 +03:00
parent a53ad098d6
commit 542ab6ae34
2 changed files with 2 additions and 1 deletions
@@ -395,6 +395,7 @@ public fun String.toDouble(): Double = java.lang.Double.parseDouble(this)
/**
* Returns the list of all characters in this string.
*/
@Deprecated("Use toList() instead.", ReplaceWith("toList()"))
public fun String.toCharList(): List<Char> = toCharArray().toList()
/**
@@ -37,7 +37,7 @@ class CollectionJVMTest {
@test fun flatMap() {
val data = listOf("", "foo", "bar", "x", "")
val characters = data.flatMap { it.toCharList() }
val characters = data.flatMap { it.toList() }
println("Got list of characters ${characters}")
assertEquals(7, characters.size)
val text = characters.joinToString("")