Deprecate String.toCharList to use toList instead.
This commit is contained in:
@@ -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("")
|
||||
|
||||
Reference in New Issue
Block a user