# BigText.TextPos(Text) Method
> Version: _Available or changed with runtime version 1.0._
Gets the position at which a specific string first occurs in this BigText instance.
## Syntax
```al
Position :=   BigText.TextPos(String: Text)
```
## Parameters
BigText
Type: bigtext-data-type
An instance of the bigtext-data-type data type.
String
Type: ../text/text-data-type
The text string to search for in the BigText variable. If this parameter is empty, then 0 is returned.
## Return Value
Position
Type: ../integer/integer-data-type
The position at which a specific string first occurs in this BigText instance.
## Remarks
The first character in a BigText variable is position 1.
## Example 1
The following examples show how to use the bigtext-textpos-method. These examples require that you create the following global variables and text constant.
```al
var
    MyBigText: BigText;
    VarPosition: Text;
    Text000: Label 'VarPosition = %1';
```
The following examples first initialize the content of the BigText variable with the text ABCDEFG.
In this example, the first occurrence of the character B \(the first character of the specified text\) is found in the second position in the MyBigText variable so the method returns 2. The return value is stored in the variable VarPosition and displayed in a message box.
```al
MyBigText.AddText('ABCDEFG');
VarPosition := MyBigText.TextPos('BCD'); // Returns 2.
Message(Text000, VarPosition);
```
## Example 2
In the following example, the method returns 0 because the specified string is not found in the MyBigText variable. The return value is stored in the variable VarPosition and displayed in a message box.
```al
MyBigText.AddText('ABCDEFG');
VarPosition := MyBigText.TextPos(''); // Returns 0.
Message(Text000, VarPosition);
```
## Example 3
In the following example, the method returns 0 because the specified string is not found in the MyBigText variable. The return value is stored in the variable VarPosition and displayed in a message box.
```al
MyBigText.AddText('ABCDEFG');
VarPosition := MyBigText.TextPos('XYZ'); // Returns 0.
Message(Text000, VarPosition);
```
## Related information
bigtext-data-type
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/bigtext/bigtext-textpos-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/bigtext/bigtext-textpos-method/
