How to remove comma separated value from a string?

后端 未结 10 1851
你的背包
你的背包 2021-01-03 00:13

I want to remove a comma separated value from the string..

suppose I have a string like this

string x=\"r, v, l, m\"

and i want to

10条回答
  •  -上瘾入骨i
    2021-01-03 01:09

    Not going about this right. Do you need to keep the string? I doubt you do. Just use a list instead. Can you have duplicates? If not:

    offIdColl = my_Order.CustomOfferAppliedonOrder.TrimEnd(',').Split(',');
    
    if (offIdColl.Contains(OfferID.ToString()))
    {
        offIdColl.Remove(OfferID.ToString());
    }
    

提交回复
热议问题