Skip to content

Instantly share code, notes, and snippets.

@zerg000000
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerg000000/ac31da04e7598baaad26 to your computer and use it in GitHub Desktop.
Save zerg000000/ac31da04e7598baaad26 to your computer and use it in GitHub Desktop.
function trickyToString(data, withComma, withQuot) {
var outStr = "";
for( key in data ) {
outStr = outStr + quot(key, withQuot);
if(withComma) {
if(withQuot) {
outStr = outStr + "," + quot(data[key], withQuot);
} else {
outStr = outStr + ",";
}
} else {
if(withQuot) {
outStr = outStr + ";" + quot(data[key], withQuot);
} else {
outStr = outStr + ";";
}
}
outStr = outStr + "\n";
}
return outStr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment