我不知道如何映射c#中的字符串列表,
我能要一些类似的js吗?
var items = [12, 23, 14, 15, 65, 66, 33];
var ids = items.map(id => `post-${id}`);但是在IEnumerable<string>中使用C#
IEnumerable<string> ids = Product.GetRelatedProductsIds();
var posts = ?? 发布于 2016-12-15 12:45:51
int[] items = new int[] { 12, 23, 14, 15, 65, 66, 33 };
IEnumerable<string> ids = items.Select(x => $"post-{x}");IEnumerable.Select()是您的map()等效项。
https://stackoverflow.com/questions/41164032
复制相似问题