Difference between revisions of "Extensions.StringUtil.SplitString"

From emotive
Jump to navigation Jump to search
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:StringUtil]]
+
{{DISPLAYTITLE:'''SplitString '''}}[[Category:StringUtil]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | SplitString | Generates list of substrings | [[Term]] | [[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 string, StringTerm delimiter);
 
</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 will 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 will 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 will have just one element, namely the original string. If the delimiter is the empty string, the original string will be split into single characters. The search for delimiters in the string will be case sensitive.
  
{{TermReturnValue| [[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 | [[String]] | [[Term]] | - | [1] | The original string}}
+
{{TableRowPropertie1| String | [[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - | [1] | Represents the original string which will be split.}}
{{TableRowPropertie2| Delimiter | [[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;
+
/// Local Declarations
  
List1 = SplitString("emotive company", " ");
+
List<String> List_String;
 +
 
 +
/// Flow
 +
 
 +
List_String = StringUtil.SplitString("emotive company", " ");
 
</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/>
[[SubString]] <br/>
+
[[Extensions.StringUtil.SubString|SubString]] <br/>
[[LengthOfString]] <br/>
+
[[Extensions.StringUtil.LengthOfString|LengthOfString]] <br/>
[[IndexOf]] <br/>
+
[[Extensions.StringUtil.IndexOf|IndexOf]] <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:18, 13 September 2019

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 string, StringTerm delimiter);

Description

The SplitString term returns a list of strings. The returned list will 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 will 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 will have just one element, namely the original string. If the delimiter is the empty string, the original string will be split into single characters. The search for delimiters in the string will 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 will 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