Difference between revisions of "Extensions.StringUtil.SplitString"
Line 1: | Line 1: | ||
{{DISPLAYTITLE:'''SplitString '''}}[[Category:StringUtil]] | {{DISPLAYTITLE:'''SplitString '''}}[[Category:StringUtil]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | SplitString | | + | {{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 | + | 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 | + | {{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] | | + | {{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 | + | {{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> | + | List<String> List_String; |
− | + | /// Flow | |
+ | |||
+ | List_String = StringUtil.SplitString("emotive company", " "); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:52, 3 October 2018
Contents
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.
![]()
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