I was writing a quick-and-dirty library for parsing CSV files, and I can't figure out why I'm getting an "Index out of bounds" error:
char[][] splitAtComma(char[] i) {
char[][] ret;
int f = 0;
foreach (c; i) {
if (c == ',') {
f++; ret[f]=[];
} else {
ret[f] ~= c;
}
}
return ret;
}