Here's your version translated to C#: xs.Aggregate("", (prev, cur) => { if (prev != "a" && cur != "a") parseLine(cur); return cur; }); Working demo: https://repl.it/EwaE
That's why one should use more than a single one-line function per program.
> map parse . filter (not . startsWith "a") Almost! You have to skip two lines.
> for (int i =0;i<len;i++){ if(lines[i] == "a"){ i+=2; } else{ parseLine(lines[i]); } } You must be one of those managers who like to dabble in coding! I don't even know what you wanted to do. Is that C++? That part…
Here's your version translated to C#: xs.Aggregate("", (prev, cur) => { if (prev != "a" && cur != "a") parseLine(cur); return cur; }); Working demo: https://repl.it/EwaE
That's why one should use more than a single one-line function per program.
> map parse . filter (not . startsWith "a") Almost! You have to skip two lines.
> for (int i =0;i<len;i++){ if(lines[i] == "a"){ i+=2; } else{ parseLine(lines[i]); } } You must be one of those managers who like to dabble in coding! I don't even know what you wanted to do. Is that C++? That part…