马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- string shopList = "我是大浪,你的小狼";
- this.ShopId="你的小狼";
- bool existsShopId = false;
- if (!string.IsNullOrEmpty(shopList))
- {
- existsShopId = shopList.Split(',').Any(part => part.Trim() == this.ShopId);
- }
复制代码 查抄 goodsIdSet 中的每个元素是否都在 bindGoodsListIdSet 中
- string goodsId= "我是大浪";
- string BindGoodsListId="你的小狼,我是大浪";
- // 将字符串拆分为集合
- HashSet<string> goodsIdSet = new HashSet<string>(goodsId.Split(','));
- HashSet<string> bindGoodsListIdSet = new HashSet<string>(BindGoodsListId.Split(','));
- // 检查 goodsIdSet 中的每个元素是否都在 bindGoodsListIdSet 中
- bool allGoodsIdsExist = goodsIdSet.All(id => bindGoodsListIdSet.Contains(id));
复制代码 查抄 goodsIdSet 中的恣意一个元素是否在 bindGoodsListIdSet 中
- string goodsId= "我是大浪";
- string BindGoodsListId="你的小狼,我是大浪";
- // 将字符串拆分为集合
- HashSet<string> goodsIdSet = new HashSet<string>(goodsId.Split(','));
- HashSet<string> bindGoodsListIdSet = new HashSet<string>(BindGoodsListId.Split(','));
- // 检查 goodsIdSet 中的任意一个元素是否在 bindGoodsListIdSet 中
- bool anyGoodsIdExists = goodsIdSet.Any(id => bindGoodsListIdSet.Contains(id));
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |