![]() |
OTX Reference
|
|
Number of characters in a string More...

Public Attributes | |
| StringTerm | _string |
| Cardinality [1] Represents the input string whose length shall be retrieved. More... | |
Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term | |
| MetaData | metaData |
| Cardinality [0..1] The MetaData type allows tools to store additional, mainly tool-specific data. More... | |
Number of characters in a string
The term LengthOfString returns the number of characters of a given String in UTF-8 encoding. The length is equal to the number of 8-bit Unicode characters in the string.
Important: The OTX-Runtime API uses UTF-8 to encode the text in a string. A character instance represents an 8-bit code unit. UTF-8 supports all valid code points using a variable-width encoding of one to four one-byte (8-bit) code units. All string operations of the extension work on the basis of the 8-bit code units. This means, for example, that the term LengthOfString returns the value 3 and not 1 for the euro sign "€", since "€" consists of three 8-bit code units.
Important: This term only returns a correct number that humans perceive as a single character for
ASCII-CODE characters! The string should therefore not contain any special characters.
| StringTerm OpenTestSystem.Otx.Extensions.StringUtil.Terms.LengthOfString._string |
Cardinality [1]
Represents the input string whose length shall be retrieved.