C#, 计算字符串里有多少个指定字符

1 int number = a.Count<char>(c => c == '@');

猜你喜欢

转载自www.cnblogs.com/dyfisgod/p/9394303.html