isSSN returns true if string s is a valid U.S. Social Security Number. Must be 9 digits.
(String s)
| 560 | |
| 561 | /** isSSN returns true if string s is a valid U.S. Social Security Number. Must be 9 digits. */ |
| 562 | public static boolean isSSN(String s) { |
| 563 | if (isEmpty(s)) return defaultEmptyOK; |
| 564 | |
| 565 | String normalizedSSN = stripCharsInBag(s, SSNDelimiters); |
| 566 | |
| 567 | return (isInteger(normalizedSSN) && normalizedSSN.length() == digitsInSocialSecurityNumber); |
| 568 | } |
| 569 | |
| 570 | /** isUSPhoneNumber returns true if string s is a valid U.S. Phone Number. Must be 10 digits. */ |
| 571 | public static boolean isUSPhoneNumber(String s) { |
nothing calls this directly
no test coverage detected