Difference between revisions of "Extensions.StringUtil.SplitString"

From emotive
Jump to navigation Jump to search
Line 5: Line 5:
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
ListTerm = StringUtil.SplitString(StringTerm, StringTerm);
+
/// Local Declarations
 +
List<String> ListVariable;
 +
/// Flow
 +
ListVariable = StringUtil.SplitString(StringTerm, StringTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 22: Line 25:
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 +
/// Local Declarations
 +
 
List<String> List_String;
 
List<String> List_String;
  

Revision as of 09:00, 25 October 2018

Classification

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

OTL Syntax

/// Local Declarations
List<String> ListVariable;
/// Flow
ListVariable = StringUtil.SplitString(StringTerm, StringTerm);

Description

The SplitString term returns a list of strings. The returned list shall contain each substring of the original string that is terminated by a given delimiter string or by the end of the string. The substrings in the resulting list shall be in the order in which they occur in the original string. If the delimiter does not occur in any part of the original string, then the resulting list shall have just one element, namely the original string. If the delimiter is the empty string, the original string shall be split into single characters. The search for delimiters in the string shall be case sensitive.

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] Represents the original string which shall be split.
Delimiter String Term - [1] Represents the delimiter string. The original string is split at each place where a delimiter string occurs.

OTL Examples

/// Local Declarations

List<String> List_String;

/// Flow

List_String = StringUtil.SplitString("emotive company", " ");

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
ToUpper
ToLower
Encode
Decode