Difference between revisions of "Extensions.StringUtil.SplitString"

From emotive
Jump to navigation Jump to search
(Created page with "Category:StringUtil == Classification == {{ClassificationActivity | SplitString | Generates list of substrings | Term | OTX StringUtil extension | Str...")
 
Line 22: Line 22:
 
== Examples ==
 
== Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
Integer result = SplitString("emotive", "");
+
List<String> result = SplitString("emotive", "");
 
//Returns result = {"e", "m", "o", "t", "i", "v", "e"}
 
//Returns result = {"e", "m", "o", "t", "i", "v", "e"}
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 04:50, 8 August 2014

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

Pseudo-Code Syntax

List<String> SplitString(String string, String delimiter);

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

Examples

List<String> result = SplitString("emotive", "");
//Returns result = {"e", "m", "o", "t", "i", "v", "e"}

See also

ReplaceSubString
MatchToRegularExpression
StringConcatenate
SubString
LengthOfString
IndexOf
ToUpper
ToLower
Encode
Decode