判断字符串出现的多个位置

例如 : 1234563 如何判断3出现的位置

var indexs = "1234533"
    .Select((item, index) => new { item, index })
    .Where(t => t.item == '3')
    .Select(t => t.index)
    .ToList();

Linq真是太方便了~

posted @ 2021-03-12 10:37  果冻栋吖  阅读(91)  评论(0编辑  收藏  举报