# TXBarcodeCore.IsTextValid Method

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 33.0
- **Namespace:** `TXTextControl.Barcode`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXBarcode.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXBarcode.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXBarcode.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Barcode > TXBarcodeCore.IsTextValid Method
- **778 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/txbarcodecore/istextvalid-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/txbarcodecore/istextvalid-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/txbarcodecore/istextvalid-method/llms-full.txt

---

### Description

Returns a value indicating whether the specified text is valid for a specific [barcode type](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/barcodetype/enumeration/llms-full.txt). In case of an invalid text, an exception message is saved into the specified string.

### Syntax

```csharp
public static bool IsTextValid(BarcodeType barcodeType, string text, out string errorMessage);
```

```vbnet
Public Shared Function IsTextValid(barcodeType As BarcodeType, text As String, ByRef errorMessage As String) As Boolean
```

### Parameters

| Parameter | Description |
|---|---|
| barcodeType | Specifies the [barcode type](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/barcodetype/enumeration/llms-full.txt) 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/barcodetype/enumeration/llms-full.txt). |

### Return Value

True, if the specified text is valid for a specific [barcode type](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/barcodetype/enumeration/llms-full.txt). Otherwise false.

### Examples

The following example checks whether text valid applies to the txbarcode core.

```csharp
string errorMessage = "Quarterly report";
if (TXTextControl.Barcode.TXBarcodeCore.IsTextValid(TXTextControl.Barcode.BarcodeType.QRCode, "Quarterly results", out errorMessage))
{
    Console.WriteLine("Is Text Valid completed successfully.");
}
```

```vbnet
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
```

---

## Nearby

- **Previous:** [TXBarcodeCore.GetSVG Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/txbarcodecore/getsvg-method/llms-full.txt)
- **Next:** [TXBarcodeCore.Load Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-barcode/txbarcodecore/load-method/llms-full.txt)
