Skip to content

Commit

Permalink
Add constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
nixonwidjaja committed Nov 13, 2023
1 parent 5b373b2 commit ac83f53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/seedu/address/model/person/Phone.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public Phone(String phone) {
* Returns true if a given string is a valid phone number.
*/
public static boolean isValidPhone(String test) {
if (test.length() < 3) {
return false;
}
if (test.charAt(0) == '+') {
test = test.substring(1);
}
Expand Down

0 comments on commit ac83f53

Please sign in to comment.