Sat Jan 08 2022 10:01:09 GMT+0000 (Coordinated Universal Time)
Saved by @hasnat
func isValidPhone(_ mobilenumber: String) -> Bool { let phoneRegex = "^[0-9+]{0,1}+[0-9]{5,16}$" let phoneTest = NSPredicate(format: "SELF MATCHES %@", phoneRegex) return phoneTest.evaluate(with: mobilenumber) }
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments