zoukankan      html  css  js  c++  java
  • C# 过滤字典中的数据 并将过滤后的数据转成新的字典对象

                    Dictionary<string, object> dic = new Dictionary<string, object>();
                    dic.Add("DistrictID_1", "123");
                    dic.Add("Dist_1", "456");
                    dic.Add("DistD_1", "555");
                    dic.Add("Dff_1", "666");
                    dic.Add("DistrictID_2", "123");
                    dic.Add("Dist_2", "456");
                    dic.Add("DistD_2", "555");
                    dic.Add("Dff_2", "666");
    
                    var re = dic.Where(p => p.Key == "DistrictID_1").Select(p => p.Key);
    
                    var formList = (from p in dic where p.Key.Contains("_1") select p);
                    Dictionary<string, object> dic1 = formList.ToDictionary(k => k.Key, v => v.Val);
  • 相关阅读:
    [NOI2008] 糖果雨
    [NOI2006] 神奇口袋
    [NOI2014] 购票
    Prince and Princess HDU
    Network POJ
    CodeForces
    Codeforces Global Round 12
    Codeforces Round #688 (Div. 2)
    [USACO05DEC]Layout G
    # Technocup 2021
  • 原文地址:https://www.cnblogs.com/LittleBai/p/11389704.html
Copyright © 2011-2022 走看看