There are plenty of methods to achieve this but even though it’s simple task you need to specify requirements like:
- are white spaces allowed?
- how to treat empty string?
- what’s the maximum length of the string?
In this article I want to describe 3 different ideas how to solve this problem.Continue reading C# – How to check if string contains only digits