OTX Reference  
OpenTestSystem.Otx.Extensions.StringUtil.Terms.LengthOfString Class Reference

Number of characters in a string More...

Inheritance diagram for OpenTestSystem.Otx.Extensions.StringUtil.Terms.LengthOfString:
Inheritance graph

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

Detailed Description

Number of characters in a string

The LengthOfString term gives the number of characters in a String.

Important: This term shall only be used for ASCII-CODE characters!

Note: Inside the The OTX-runtime the data type String handles bytes independently of the encoding used. If used to handle sequences of multi-byte characters (such as UTF-8), all operations, such as LengthOfString, will still operate in terms of bytes and not the encoded characters! E.g. StringUtil.LengthOfString("€"); returns 3 and not 1, because "€" consists of 3 bytes in UTF-8.

Syntax
IntegerTerm = StringUtil.LengthOfString(StringTerm string);
Examples
// Local Declarations
Integer Integer1;
// Flow
Integer1 = StringUtil.LengthOfString("emotive company");

Member Data Documentation

◆ _string

StringTerm OpenTestSystem.Otx.Extensions.StringUtil.Terms.LengthOfString._string

Cardinality [1]
Represents the input string whose length shall be retrieved.