Condividi tramite


Estensioni di stringa

Il StringExtensions tipo contiene helper ed estensioni per string gli oggetti, inclusi i metodi di convalida per scenari comuni.

Sintassi

using CommunityToolkit.WinUI;

string str = "test@test.com";
bool isValid = str.IsEmail();    //Returns true

string str = "123+888";
bool isValid = str.IsDecimal();  //Returns false

Formati supportati per l'estensione Is Telefono Number

(987) 654-3210
(987)654-3210
987-654-3210
9876543210
+1 9876543210
001 9876543210
001 987-654-3210
19876543210
1-987-654-3210

Esempi

Altri esempi sono disponibili negli unit test.