Kotlin Split String to Variables

May 14, 2019
val content = "Hello\nWelcome to Malaysia"

val (greeting, message) = content.split("\n")

NOTE: Destructuring Declarations

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.