Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. private bool IsValidNumber(string str)
  2. {
  3. const int VALID_LENGTH = 10;
  4. bool valid = true;
  5.  
  6. if (str.Length == VALID_LENGTH)
  7. {
  8. foreach (char ch in str)
  9. {
  10. if (char.IsLower(ch))
  11. {
  12. valid = false;
  13. }
  14. }
  15. }
  16. else
  17. {
  18. valid = false;
  19. }
  20.  
  21. return valid;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement