Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hskl
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
hskl
10y ago
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
2.
▲
by
hskl
10y ago
That's why one should use more than a single one-line function per program.
3.
▲
by
hskl
10y ago
> map parse . filter (not . startsWith "a") Almost! You have to skip two lines.
4.
▲
by
hskl
10y ago
> 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 `li