Skip to main content

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.

Back to lesson: Practice: Text workshop