Difference between revisions of "Extensions.StringUtil.SplitString"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:'''SplitString '''}}[[Category:StringUtil]]
 
{{DISPLAYTITLE:'''SplitString '''}}[[Category:StringUtil]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | SplitString | Generates list of substrings | [[Term]] | [[Extensions.StringUtil|OTX StringUtil extension]] | [[StringUtil related terms]] | - | - }}
+
{{ClassificationActivity | SplitString | Return a list of strings | [[Term]] | [[Extensions.StringUtil|OTX StringUtil extension]] | [[Extensions.StringUtil#Terms|StringUtil related terms]] | - | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
ListTerm = SplitString(StringTerm, StringTerm);
+
ListTerm = StringUtil.SplitString(StringTerm, StringTerm);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== 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.
+
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.
  
{{TermReturnValue| [[Core.DataTypes.ComplexDataType.ContainerDataType.List|List]] | The list of substrings separated by the delimiter.}}
+
{{TermReturnValue| [[Core.DataTypes.ComplexDataType.List|List]] | The list of substrings separated by the delimiter.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| String | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | The original string}}
+
{{TableRowPropertie1| String | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the original string which shall be split.}}
{{TableRowPropertie2| Delimiter | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | The original string is split at any place where a delimiter string is occurence}}
+
{{TableRowPropertie2| Delimiter | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the delimiter string. The original string is split at each place where a delimiter string occurs.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
List<String> List1;
+
List<String> List_String;
  
List1 = SplitString("emotive company", " ");
+
/// Flow
 +
 
 +
List_String = StringUtil.SplitString("emotive company", " ");
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 09:52, 3 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

ListTerm = 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

List<String> List_String;

/// Flow

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

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
ToUpper
ToLower
Encode
Decode