0

Kotlin – Convert comma-separated String to a List

This post shows how to convert a comma-separated strings (CSVs) to a list and back. In Kotlin, we can create both immutable or mutable lists.

Requirements

  • IntelliJ IDEA Ultimate 2016.3
    • The Community Edition may be enough but we have not tried it.
  • Kotlin Version 1.1
  • Windows 10 Enterprise

CSV String to list

Outputs:

List to CSV string

Outputs:

References