Difference between revisions of "Extensions.StringUtil.SubString"

From emotive
Jump to navigation Jump to search
(Created page with "Category:StringUtil == Classification == {{ClassificationActivity | SubString | Locate a substring | Term | OTX StringUtil extension | StringUtil rela...")
 
Line 3: Line 3:
 
{{ClassificationActivity | SubString | Locate a substring | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | [[OutOfBoundsException]] | - }}
 
{{ClassificationActivity | SubString | Locate a substring | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | [[OutOfBoundsException]] | - }}
  
== Pseudo-Code Syntax ==
+
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
String SubString(String string, Integer index, Integer count);
+
StringTerm = SubString(StringTerm, IntegerTerm, IntegerTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 21: Line 21:
 
|}
 
|}
  
== Examples ==
+
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
String result = SubString("emotive", 0, 3);
+
String String1;
//Returns result = "emo"
+
 
 +
String1 = SubString("emotive company", 8, 7);
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 10:38, 10 February 2015

Classification

Name SubString
Short Description Locate a substring
Class Term
Extension OTX StringUtil extension
Group StringUtil related terms
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

OTL Syntax

StringTerm = SubString(StringTerm, IntegerTerm, IntegerTerm);

Description

The SubString term returns a substring of a string . The substring is determined by the index and count element.

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] The original string
Index Integer Term - [1] The zero-based position at which the substring begins
Count Integer Term - [1] The number of characters that will be read from the original string.

OTL Examples

String String1;

String1 = SubString("emotive company", 8, 7);

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
LengthOfString
IndexOf
SplitString
ToUpper
ToLower
Encode
Decode