Skip to content

Instantly share code, notes, and snippets.

Last active Dec 12, 2015
What would you like to do?
LTSV parser/dumper of dart lang
class LTSV {
static Map parse(String str) {
var pairs = str.trim().split("\t");
var ret = {};
for (var pair in pairs) {
var chunks = pair.split(":");
var name = chunks.removeAt(0);
ret[name] = chunks.join(":");
return ret;
static String dump(Map map) {
var chunks =>"${k}:${map[k]}");
return "${chunks.join("\t")}\n";
main() {
var str = "a:1\tb:2\n";
var parsed = LTSV.parse(str);
Copy link

tomotaka commented Jul 30, 2014

I uploaded this as a pub package!
and created a repo for this:
maintenance of this code will be done on this new repository!
(I think my activities will not be so active about this repo, but any modifications are welcome.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment