如何获取一句话中有几个逗号 c#

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/27 18:55:11

如何获取一句话中有几个逗号 c#

string str = ",This,is,arthur!What's your name?a,b ,c,";
int count = str.Split(',').Length - 1;
count为逗号个数