Extensions.StringUtil.SubString
Jump to navigation
Jump to search
Contents
Classification
Name | SubString |
Short Description | Substring of a string |
Class | Term |
Extension | OTX StringUtil extension |
Group | StringUtil related terms |
Exceptions | OutOfBoundsException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
StringTerm StringUtil.SubString(StringTerm string, NumericTerm index, NumericTerm count);
Description
The SubString term will return a sub-string read out of a given string. The to-be-read sub-string is defined by index and count arguments.
Return Value
The Term returns the value, see table below.
In OTX, Terms are categorized according to its return data type!
Data Type | Description |
String | The substring of a string |
Properties
Name | Data Type | Class | Default | Cardinality | Description |
String | String | Term | - | [1] | Represents the input string from which a sub-string will be extracted. |
Index | Numeric | Term | - | [1] | Represents the index starting from which the sub-string will be read. Float values will be truncated. |
Count | Numeric | Term | - | [1] | Represents the number of characters to be read from the original string. Reading will not exceed the last character in the input string (so the resulting sub-string length will be less than <count> in some cases). Float values will be truncated. |
OTL Examples
/// Local Declarations
String String1;
/// Flow
String1 = StringUtil.SubString("emotive company", 8, 7);
See also
ReplaceSubString
MatchToRegularExpression
StringConcatenate
LengthOfString
IndexOf
SplitString
ToUpper
ToLower
Encode
Decode