find if an integer exists in a list of integers

后端 未结 8 1359
执笔经年
执笔经年 2020-12-14 05:40

i have this code:

  List apps = getApps();

        List ids;

        List dropdown = apps.ConvertAll(c => new          


        
8条回答
  •  攒了一身酷
    2020-12-14 06:05

    bool vExist = false;
    int vSelectValue = 1;
    
    List vList = new List();
    vList.Add(1);
    vList.Add(2);
    
    IEnumerable vRes = (from n in vListwhere n == vSelectValue);
    if (vRes.Count > 0) {
        vExist = true;
    }
    

提交回复
热议问题