how to get count of '#' in a string?
本问题已经有最佳答案,请猛点这里访问。
Possible Duplicate:
How would you count occurences of a string within a string (C#)?
号
如何获取字符串中出现""的次数?
有点像
示例字符串"grtkj mfr"
rowformat必须返回4
是的,^.net 3.5
1 | int RowFormat ="grtkj####mfr".Count(ch => ch == '#'); |
(这是茶与LINQ的愤怒,这些天):P></
1 | int RowFormat = drr[3].Count(x => x == '#'); |
check thisP></
1 |
希望这会帮助。P></
1 |