Practice · 4 of 4
Digit counter
CHALLENGE
Difficulty: beginner+25 XP
Implement static int CountDigits(string s) — how many characters are decimal digits (use char.IsDigit, so '٥'-style Unicode digits count too — any char.IsDigit true). Null or empty yields 0.
Press Submit to check your solution.
Back to lesson: Practice: Text workshop