A simple validator library for various things, such as coordinates, credit cards, domain names, emails, IBANs, IP addresses, ISBNs, and more.
View documentation »
Report Bug
·
Request Feature
·
Known Issues
- Validate coordinates.
- Validate credit card numbers.
- Validate domain names.
- Validate email addresses.
- Validate IBANs.
- Validate IP addresses.
- Validate ISBNs.
- More features are planned for future releases.
- Install XValid via NuGet using the following command:
Install-Package XValid
or
dotnet add package XValid
-
Import the
XValid
namespace in your C# code. -
Start validating!
using XValid;
double latitude = 40.7128; // Example latitude
double longitude = -74.0060; // Example longitude
bool isValidCoordinate = CoordinateValidator.IsValidCoordinate(latitude, longitude);
using XValid;
string creditCardNumber = "4111 1111 1111 1111"; // Example card number (Visa)
bool isValidCreditCard = CreditCardValidator.IsValidCreditCardNumber(creditCardNumber);
using XValid;
string domainName = "example.com";
bool isValidDomainName = DomainNameValidator.IsValid(domainName);
using XValid;
string email = "user@example.com";
bool isValidEmail = EmailValidator.IsValidEmail(email);
using XValid;
string iban = "DE89370400440532013000"; // Example IBAN (Germany)
bool isValidIBAN = IBANValidator.IsValidIBAN(iban);
using XValid;
string ipAddress = "192.0.2.1"; // Example IP address
bool isValidIPAddress = IPAddressValidator.IsValidIPAddress(ipAddress);
using XValid;
string isbn = "978-3-16-148410-0";
bool isValidISBN = ISBNValidator.IsValidISBN(isbn);
To contribute to XValid, follow these steps:
- Ensure you have the following tools installed:
- Visual Studio 2022 v17.0 or higher
- .NET 6.0 SDK
- Git
- .NET 6
- Fork the XValid repository and clone it to your local machine.
- Make your changes or add new features.
- Write tests to ensure the changes are functioning as expected.
- Submit a pull request to the main repository.
For more detailed guidelines, check out the contribution guidelines.
This project is under the MIT License.