Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool IsValidNumber(string str)
- {
- const int VALID_LENGTH = 10;
- bool valid = true;
- if (str.Length == VALID_LENGTH)
- {
- foreach (char ch in str)
- {
- if (char.IsLower(ch))
- {
- valid = false;
- }
- }
- }
- else
- {
- valid = false;
- }
- return valid;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement