I'm a bit confused. I have this csv line with double quote("") as grouped strings, and want to convert to Kotlin List. However it produces a single array with size 1. I want to be able to get the group, assumes at position 2.
val s = "John Doe, 13, \"Subject 1, Subject 2, Subject 3\""
var list: List<String> = s.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)")
Log.d("size:", list.size.toString() + " - subjects:" + list[2])
This gives me error
java.lang.IndexOutOfBoundsException: Index: 2, Size: 1