how do I get the count of the occurrences of '#' in a string ?
something like int RowFormat = drr[3].ToString("#").Length;
example string "grtkj####mfr "
RowFormat must return 4
and yes ^_^ .NET 3.5
how do I get the count of the occurrences of '#' in a string ?
something like int RowFormat = drr[3].ToString("#").Length;
example string "grtkj####mfr "
RowFormat must return 4
and yes ^_^ .NET 3.5
Check this
"grtkj####mfr".Split(new char[]{'#'}).Length-1
hope that will help.
With LINQ (that's all the rage these days):
int RowFormat = drr[3].Count(x => x == '#');
This question already holds the answer to what you're looking for.