IsTextValid Method
- Namespace
TXTextControl.Barcode
- Package
TXTextControl.asTextControl. Core. SDK TXBarcode.from the private NuGet feed or Text Control Offline Packagesdll
- Also in
TXTextControl.asTextControl. ASP. SDK TXBarcode.dll
Description
Returns a value indicating whether the specified text is valid for a specific barcode type. In case of an invalid text, an exception message is saved into the specified string.
Syntax
public static bool IsTextValid(BarcodeType barcodeType, string text, out string errorMessage);Public Shared Function IsTextValid(barcodeType As BarcodeType, text As String, ByRef errorMessage As String) As BooleanParameters
| Parameter | Description |
|---|---|
| barcodeType | Specifies the barcode type whose text is checked. |
| text | Specifies the text to check. |
| errorMessage | Specifies the string, an appropriate exception message is saved to, if the checked text is not valid for a specific barcode type. |
Return Value
True, if the specified text is valid for a specific barcode type. Otherwise false.
Examples
The following example checks whether text valid applies to the txbarcode core.
string errorMessage = "Quarterly report";
if (TXTextControl.Barcode.TXBarcodeCore.IsTextValid(TXTextControl.Barcode.BarcodeType.QRCode, "Quarterly results", out errorMessage))
{
Console.WriteLine("Is Text Valid completed successfully.");
}Dim errorMessage As String = "Quarterly report"
If TXTextControl.Barcode.TXBarcodeCore.IsTextValid(TXTextControl.Barcode.BarcodeType.QRCode, "Quarterly results", errorMessage) Then
Console.WriteLine("Is Text Valid completed successfully.")
End If