Kotlin文字列trim

先頭と末尾の空白を削除します。

構文

str.trim()

使用例

下記の値を入力するとサンプルに即時反映されます。

println
Hello
println("  Hello  ".trim()) // Hello