Skip to content

Instantly share code, notes, and snippets.

@prathyvsh
Created May 7, 2020 19:30
Show Gist options
  • Save prathyvsh/ba553373c35853729db9890d15e1f812 to your computer and use it in GitHub Desktop.
Save prathyvsh/ba553373c35853729db9890d15e1f812 to your computer and use it in GitHub Desktop.
Iterable<Map<String,int>>parseCSV(String csv) {
return csv.split("\n").map((String s) {
List<String> kv = s.split(",");
String k = kv[0];
num v = int.parse(kv[1]);
return {k: v};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment