{"title":"Label data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/label/label-data-type/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/label/label-data-type","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Denotes a string constant that can be optionally translated into multiple languages.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Instance methods","slug":"instance-methods","at":145,"chars":2904},{"level":2,"title":"Parameters","slug":"parameters","at":3049,"chars":432},{"level":2,"title":"Syntax example","slug":"syntax-example","at":3481,"chars":103},{"level":2,"title":"Remarks","slug":"remarks","at":3584,"chars":204},{"level":2,"title":"Related information","slug":"related-information","at":3788,"chars":117}],"text":"> Version: _Available or changed with runtime version 1.0._\nDenotes a string constant that can be optionally translated into multiple languages.\n## Instance methods\nThe following methods are available on instances of the Label data type.\nMethod name|Description\nContains(Text)<label-contains-method>|Returns a value indicating whether a specified substring occurs within this string.\nEndsWith(Text)<label-endswith-method>|Determines whether the end of this string instance matches the specified string.\nIndexOf(Text [, Integer])<label-indexof-method>|Reports the one-based index of the first occurrence of the specified string in this instance.\nlabel-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.\nlabel-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.\nLastIndexOf(Text [, Integer])<label-lastindexof-method>|Reports the one-based index position of the last occurrence of a specified string in this instance.\nPadLeft(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.\nPadRight(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.\nRemove(Integer [, Integer])<label-remove-method>|Returns a new Text in which a specified number of characters from the current string are deleted.\nReplace(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.\nlabel-split-text-method|Splits a string into a maximum number of substrings based on a collection of separators.\nlabel-split-list[text]-method|Splits a string into a maximum number of substrings based on a collection of separators.\nlabel-split-list[char]-method|Splits a string into a maximum number of substrings based on a collection of separators.\nStartsWith(Text)<label-startswith-method>|Determines whether the beginning of this instance matches a specified string.\nSubstring(Integer [, Integer])<label-substring-method>|Retrieves a substring from this instance.\nlabel-tolower-method|Returns a copy of this string converted to lowercase.\nlabel-toupper-method|Returns a copy of this string converted to uppercase.\nlabel-trim-method|Returns a new Text in which all leading and trailing white-space characters from the current Text object are removed.\nTrimEnd([Text])<label-trimend-method>|Removes all trailing occurrences of a set of characters specified in an array from the current Text object.\nTrimStart([Text])<label-trimstart-method>|Removes all leading occurrences of a set of characters specified in an array from the current Text object.\n## Parameters\nAll of the parameters below are optional and the order is not enforced.\nAttribute|Description\nComment|Used for general comments about the label, specifically about the placeholders in that label.\nLocked|When Locked is set to true, the label should not be translated. Default value is false.\nMaxLength|Determines how much of the label is used.</br> `<br>If no maximum length is specified, the string can be any length.\n## Syntax example\n```al\nvar\n    a : Label 'Label Text', Comment='Foo', MaxLength=999, Locked=true;\n```\n## Remarks\nThe Label data type is used in .xlf files for translations. See ../../devenv-work-with-translation-files.\nFor information about naming, see CodeCop Rule AA0074<../../analyzers/codecop-aa0074>.\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}