I want to count the words and spaces in my line. The line looks like this:
Command do something ptuf(123) and bo(1).ctq[5] v:0,
I have something like this so far
int count = 0; string mystring = "Command do something ptuf(123) and bo(1).ctq[5] v:0,"; foreach(char c in mystring) { if(char.IsLetter(c)) { count++; } }
What should I do to count spaces?
c # visual-studio-2010 winforms
user2592968
source share