Difference between revisions of "StringSplit"
CGHelpdesk (talk | contribs) |
CGHelpdesk (talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | __NOTOC__ | |
==stringSplit == | ==stringSplit == | ||
Line 5: | Line 5: | ||
'''Important note:''' If the separator string is multi characters such as "c23er", then the separator will be treated the seperated characters with the OR logic. See below example: | '''Important note:''' If the separator string is multi characters such as "c23er", then the separator will be treated the seperated characters with the OR logic. See below example: | ||
+ | <br/> | ||
<source lang="javascript"> | <source lang="javascript"> | ||
string str = "abcdef && 123456"; | string str = "abcdef && 123456"; | ||
Line 21: | Line 22: | ||
=== Return type === | === Return type === | ||
− | array | + | '''array''' |
=== Examples === | === Examples === | ||
Line 27: | Line 28: | ||
''print(stringSplit("Hello", "ll")); //Result: {He,,o} '' | ''print(stringSplit("Hello", "ll")); //Result: {He,,o} '' | ||
</source> | </source> | ||
− | + | <br/> | |
<source lang="javascript"> | <source lang="javascript"> | ||
string str = "abcdef && 123456"; | string str = "abcdef && 123456"; |
Revision as of 05:45, 19 September 2013
stringSplit
Returns a string array containing the sub strings in a string that are delimited by elements of a specified string.
Important note: If the separator string is multi characters such as "c23er", then the separator will be treated the seperated characters with the OR logic. See below example:
string str = "abcdef && 123456";
print(stringSplit(str, "2&2")); // result: {abcdef ,, 1,3456}
print(stringSplit(str, "c2")); // result: {ab,def && 1,3456}
Syntax
stringSplit(string_expression, separator)
Arguments
string_exp: Is a string expression.separator: Is a string expression.
Return type
array
Examples
''print(stringSplit("Hello", "ll")); //Result: {He,,o} ''
string str = "abcdef && 123456";
print(stringSplit(str, "2&2")); // result: {abcdef ,, 1,3456}
print(stringSplit(str, "c2")); // result: {ab,def && 1,3456}