用种子减少字符串数组
Reduce with seed an array of strings
是否可以将种子作为字符串数组来执行std.algorithm.reduce
?像这样:
reduce!(string[], (r,c) => r ~= c)([], someIterable);
当然可以,但是由于动态数组的性质,您必须先声明它:
string[] arr;
reduce!((r, c) => r~=c)(arr, someIterable);
是否可以将种子作为字符串数组来执行std.algorithm.reduce
?像这样:
reduce!(string[], (r,c) => r ~= c)([], someIterable);
当然可以,但是由于动态数组的性质,您必须先声明它:
string[] arr;
reduce!((r, c) => r~=c)(arr, someIterable);