本文介绍了检查列表中没有字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将字符串添加到数据库值并显示如果我得到重复它不应该显示相同的东西



  for  int  i =  0 ; i <  lstRecData.Count; i ++)
{
if (lstRecData [i ] .strRecDesc.ToUpper()!= strContactVib&& lstRecData [i] .strRecPriority == 3
{
lstRecData [i] .strRecDesc = 计划维护: + lstRecData [i] .strRecDesc;
}
}







一旦这个Schedule Maintenance:+ lstRecData [I] .strRecDesc;在那里我不应该执行语句我该如何实现呢?

解决方案



I am adding string to a DB value and displaying so if i get a duplicate it should not display the same thing

for (int i = 0; i < lstRecData.Count; i++)
{
    if (lstRecData[i].strRecDesc.ToUpper() != strContactVib && lstRecData[i].strRecPriority == "3")
    {
      lstRecData[i].strRecDesc = "Schedule Maintenance:" + lstRecData[i].strRecDesc;
    }
}




here once this "Schedule Maintenance:" + lstRecData[i].strRecDesc; is there i shouldn't execute the statement how can i achieve it?

解决方案



这篇关于检查列表中没有字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:24