# Label data type
> Version: _Available or changed with runtime version 1.0._
Denotes a string constant that can be optionally translated into multiple languages.
## Instance methods
The following methods are available on instances of the Label data type.
Method name|Description
Contains(Text)<label-contains-method>|Returns a value indicating whether a specified substring occurs within this string.
EndsWith(Text)<label-endswith-method>|Determines whether the end of this string instance matches the specified string.
IndexOf(Text [, Integer])<label-indexof-method>|Reports the one-based index of the first occurrence of the specified string in this instance.
label-indexofany-text-integer-method|Reports the one-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.
label-indexofany-list[char]-integer-method|Reports the one-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position.
LastIndexOf(Text [, Integer])<label-lastindexof-method>|Reports the one-based index position of the last occurrence of a specified string in this instance.
PadLeft(Integer [, Char])<label-padleft-method>|Returns a new Text that right-aligns the characters in this instance by padding them on the left, for a specified total length.
PadRight(Integer [, Char])<label-padright-method>|Returns a new string that left-aligns the characters in this string by padding them with spaces on the right, for a specified total length.
Remove(Integer [, Integer])<label-remove-method>|Returns a new Text in which a specified number of characters from the current string are deleted.
Replace(Text, Text)<label-replace-method>|Returns a new Text in which all occurrences of a specified string in the current instance are replaced with another specified string.
label-split-text-method|Splits a string into a maximum number of substrings based on a collection of separators.
label-split-list[text]-method|Splits a string into a maximum number of substrings based on a collection of separators.
label-split-list[char]-method|Splits a string into a maximum number of substrings based on a collection of separators.
StartsWith(Text)<label-startswith-method>|Determines whether the beginning of this instance matches a specified string.
Substring(Integer [, Integer])<label-substring-method>|Retrieves a substring from this instance.
label-tolower-method|Returns a copy of this string converted to lowercase.
label-toupper-method|Returns a copy of this string converted to uppercase.
label-trim-method|Returns a new Text in which all leading and trailing white-space characters from the current Text object are removed.
TrimEnd([Text])<label-trimend-method>|Removes all trailing occurrences of a set of characters specified in an array from the current Text object.
TrimStart([Text])<label-trimstart-method>|Removes all leading occurrences of a set of characters specified in an array from the current Text object.
## Parameters
All of the parameters below are optional and the order is not enforced.
Attribute|Description
Comment|Used for general comments about the label, specifically about the placeholders in that label.
Locked|When Locked is set to true, the label should not be translated. Default value is false.
MaxLength|Determines how much of the label is used.</br> `<br>If no maximum length is specified, the string can be any length.
## Syntax example
```al
var
    a : Label 'Label Text', Comment='Foo', MaxLength=999, Locked=true;
```
## Remarks
The Label data type is used in .xlf files for translations. See ../../devenv-work-with-translation-files.
For information about naming, see CodeCop Rule AA0074<../../analyzers/codecop-aa0074>.
## Related information
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/label/label-data-type, 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/label/label-data-type/
