How to get a platform-specific newline in Kotlin Multiplatform?

Viewed 118

I am seeking a function which returns a platform-specific newline string. This is possible using System.lineSeparator(), but it's only available in Kotlin/JVM. Is there any multi-platform function?

I'm aware of the expect/actual approach, but I'm searching for a shorter way. (Maybe a function in the standard library?)

1 Answers

Something like this should do the trick:

val newLine = "\n"
Related