Edit

Share via


String Extensions

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.