Created
November 8, 2021 18:33
-
-
Save manoj-mili/3db3764edbd3b4547bfbeee939a70c41 to your computer and use it in GitHub Desktop.
Code in Function Based on Name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Don't add validation in this function as the name of the function only suggest to add it to db | |
fun savePhoneNumber(phoneNumber: String) { | |
if (!phoneNumber.equals("") && phoneNumber.length == 10 && phoneNumber regex check and etc...) { | |
dao.saveNumber(phoneNumber) | |
} | |
} | |
//Do only pass numbers post validation | |
fun savePhoneNumber(phoneNumber: String) { | |
dao.saveNumber(phoneNumber) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment