Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

StringSplit: Difference between revisions

From Catglobe Wiki
Cg_pham (talk | contribs)
No edit summary
CGHelpdesk (talk | contribs)
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:String_Functions]]
__NOTOC__

==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:
<br/>
<source lang="javascript">
string str  = "abcdef && 123456";
print(stringSplit(str, "2&2"));  // result: {abcdef ,, 1,3456}
print(stringSplit(str, "c2"));  // result: {ab,def && 1,3456}
</source>
 
=== Syntax ===
 
'''stringSplit( ''string_expression'', ''separator'' )'''
 
=== Arguments ===
 
'''string_exp''': Is a string expression.
 
'''separator''': Is a string expression.
 
=== Return type ===
 
'''array'''


====stringSplit====
=== Examples ===
<source lang="javascript">
''print(stringSplit("Hello", "ll")); //Result: {He,,o}
</source>
<br/>
<source lang="javascript">
string str  = "abcdef && 123456";
print(stringSplit(str, "2&2"));  // result: {abcdef ,, 1,3456}
print(stringSplit(str, "c2"));  // result: {ab,def && 1,3456}
</source>


Returns a string array containing the sub strings in a string that are delimited by elements of a specified string.'''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"));//{He, , o}
[[Category:String_Functions]]
__NOTOC__
<!-- imported from file: 678.htm-->

Latest revision as of 04:48, 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}