Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The StringExtensions
type contains helpers and extensions for string
objects, including validation methods for common scenarios.
Syntax
using CommunityToolkit.WinUI;
string str = "test@test.com";
bool isValid = str.IsEmail(); //Returns true
string str = "123+888";
bool isValid = str.IsDecimal(); //Returns false
Formats Supported for IsPhoneNumber Extension
(987) 654-3210
(987)654-3210
987-654-3210
9876543210
+1 9876543210
001 9876543210
001 987-654-3210
19876543210
1-987-654-3210
Examples
You can find more examples in the unit tests.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Windows Community Toolkit