Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create a map from a list of Strings. Split the string with a splitter String. Useful for reading in a list of comma seperated String and converting them into a map.
fun List<String>.mapWith(split:String) = {
val components = it.split(split, limit=2)
components[0].trim() to components[1].trim()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.