[Kotlin]split()で文字列をタブで区切るサンプル

2021年7月13日

書式
文字列.split(“\t")
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
fun main() {
val cft = "study skill arkgame "
val resLst = cft.split("\t")
println("結果リスト")
for (res in resLst) {
print(res +" ")
}
}
fun main() { val cft = "study skill arkgame " val resLst = cft.split("\t") println("結果リスト") for (res in resLst) { print(res +" ") } }
fun main() {

    val cft = "study	skill	arkgame	"

    val resLst = cft.split("\t")
      println("結果リスト")
    for (res in resLst) {
        print(res +" ") 
      }
}

実行結果
>kotlin arkgame.jar
結果リスト
study skill arkgame

Kotlin

Posted by arkgame