How to break a string at each comma?

前端 未结 6 1871
再見小時候
再見小時候 2021-01-24 15:11

Hi guys I have a problem at hand that I can\'t seem to figure out, I have a string (C#) which looks like this:

string tags = \"cars, motor, whee         


        
6条回答
  •  闹比i
    闹比i (楼主)
    2021-01-24 15:46

    No loop needed. Just a call to Split():

    var individualStrings = tags.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries);
    

提交回复
热议问题