Difference between revisions of "Extensions.StringUtil.SubString"

From emotive
Jump to navigation Jump to search
m (Hb moved page SubString to Extensions.StringUtil.SubString: #3153)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:StringUtil]]
+
{{DISPLAYTITLE:'''SubString'''}}[[Category:StringUtil]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | SubString | Locate a substring | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | [[OutOfBoundsException]] | - }}
+
{{ClassificationActivity | SubString | Substring of a string | [[Term]] | [[Extensions.StringUtil|OTX StringUtil extension]] | [[Extensions.StringUtil#Terms|StringUtil related terms]] | [[Core.DataTypes.ComplexDataType.OutOfBoundsException|OutOfBoundsException]] | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
StringTerm = SubString(StringTerm, IntegerTerm, IntegerTerm);
+
StringTerm StringUtil.SubString(StringTerm string, NumericTerm index, NumericTerm count);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''SubString''' term returns a substring of a string . The substring is determined by the index and count element.
+
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.
  
{{TermReturnValue| [[String]] | The substring of a string}}
+
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | The substring of a '''string'''}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| String | [[String]] | [[Term]] | - | [1] | The original string}}
+
{{TableRowPropertie2| String | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the input string from which a sub-string will be extracted.}}
{{TableRowPropertie2| Index | [[Integer]] | [[Term]] | - | [1] | The zero-based position at which the substring begins}}
+
{{TableRowPropertie1| Index | [[Numeric]] | [[Term]] | - | [1] | Represents the index starting from which the sub-string will  be read. Float values will be truncated.}}
{{TableRowPropertie1| Count | [[Integer]] | [[Term]] | - | [1] | The number of characters that will be read from the original string.}}
+
{{TableRowPropertie2| 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 ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
/// Local Declarations
 +
 
String String1;
 
String String1;
  
String1 = SubString("emotive company", 8, 7);
+
/// Flow
 +
 
 +
String1 = StringUtil.SubString("emotive company", 8, 7);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== See also ==
 
== See also ==
[[ReplaceSubString]] <br/>
+
[[Extensions.StringUtil.ReplaceSubString|ReplaceSubString]] <br/>
[[MatchToRegularExpression]] <br/>
+
[[Extensions.StringUtil.MatchToRegularExpression|MatchToRegularExpression]] <br/>
[[StringConcatenate]] <br/>
+
[[Extensions.StringUtil.StringConcatenate|StringConcatenate]] <br/>
[[LengthOfString]] <br/>
+
[[Extensions.StringUtil.LengthOfString|LengthOfString]] <br/>
[[IndexOf]] <br/>
+
[[Extensions.StringUtil.IndexOf|IndexOf]] <br/>
[[SplitString]] <br/>
+
[[Extensions.StringUtil.SplitString|SplitString]] <br/>
[[ToUpper]] <br/>
+
[[Extensions.StringUtil.ToUpper|ToUpper]] <br/>
[[ToLower]] <br/>
+
[[Extensions.StringUtil.ToLower|ToLower]] <br/>
[[Encode]] <br/>
+
[[Extensions.StringUtil.Encode|Encode]] <br/>
[[Decode]]
+
[[Extensions.StringUtil.Decode|Decode]]

Latest revision as of 03:17, 13 September 2019

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.

Icons Note.png 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