I have many strings. Each string is prepended with at least 1 $. What is the best way to loop through the chars of each string to count how many $\
$
just a simple answer:
public static int CountChars(string myString, char myChar) { int count = 0; for (int i = 0; i < myString.Length; i++) { if (myString[i] == myChar) ++count; } return count; }
Cheers! - Rick