File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11using System . Collections ;
2+ using System . Text . RegularExpressions ;
23
34namespace CSSimpleFunctions
45{
@@ -66,6 +67,12 @@ public static bool IsValid(string str)
6667 }
6768 }
6869
70+ public static bool IsAValidPhilippineMobileNumber ( string str )
71+ {
72+ string pattern = @"^(?:09|\+639|639)\d{9}$" ;
73+ return Regex . IsMatch ( Regex . Replace ( str , @"[\s\-\(\)]" , "" ) , pattern ) ;
74+ }
75+
6976 public static bool HasNumbers ( string str )
7077 {
7178 string numbers = "0123456789" ;
Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ Check.HasSymbols("Sample text!"); // returns true
3838Check .HasSpaces (" Sample_text" ); // returns false
3939Check .HasSpaces (" Sample text" ); // returns true
4040```
41+ ### IsAValidPhilippineMobileNumber
42+ - will check a String if it is a valid Philippine mobile number
43+ - returns a boolean value
44+ ``` csharp
45+ Check .IsAValidPhilippineMobileNumber (" +15551234567" ); // returns false
46+ Check .IsAValidPhilippineMobileNumber (" 09171234567" ); // returns true
47+ ```
4148### Email.AddValidDomainName
4249- adds a valid domain name to the list of valid domain names
4350``` csharp
You can’t perform that action at this time.
0 commit comments