lambda as default argument

前端 未结 2 1897
既然无缘
既然无缘 2020-12-20 22:46

I was looking for an anwer to question Get next N elements from enumerable didn\'t find any satisfying and brewed my own. What I came up with was

IEnumerable         


        
2条回答
  •  甜味超标
    2020-12-20 23:07

    It's the same for C#: create an overload.

    IEnumerable Chunk(IEnumerable src, int n){
        return Chunk(src, n, t => t);
    }
    

提交回复
热议问题