Difference between revisions of "Extensions.StringUtil.SplitString"

From emotive
Jump to navigation Jump to search
Line 3: Line 3:
 
{{ClassificationActivity | SplitString | Generates list of substrings | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | - | - }}
 
{{ClassificationActivity | SplitString | Generates list of substrings | [[Term]] | [[StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | - | - }}
  
== Pseudo-Code Syntax ==
+
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
List<String> SplitString(String string, String delimiter);
+
ListTerm = SplitString(StringTerm, StringTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 20: Line 20:
 
|}
 
|}
  
== Examples ==
+
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
List<String> result = SplitString("emotive", "");
+
List<String> List1;
//Returns result = {"e", "m", "o", "t", "i", "v", "e"}
+
 
 +
List1 = SplitString("emotive company", " ");
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 10:41, 10 February 2015

Classification

Name SplitString
Short Description Generates list of substrings
Class Term
Extension OTX StringUtil extension
Group StringUtil related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

ListTerm = SplitString(StringTerm, StringTerm);

Description

SplitString term returns a list of strings, which contains the substrings separated by the specified delimiter. The order of the list elements corresponds to the order of occurrence in the string. If the delimiter is not found, the list contains exactly one element. The delimiter is an empty string, the string is split into his characters.

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
List The list of substrings separated by the delimiter.

Properties

Name Data Type Class Default Cardinality Description
String String Term - [1] The original string
Delimiter String Term - [1] The original string is split at any place where a delimiter string is occurence

OTL Examples

List<String> List1;

List1 = SplitString("emotive company", " ");

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
ToUpper
ToLower
Encode
Decode