Difference between revisions of "Explode"

From SCAR Divi Manual
Jump to: navigation, search
 
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function Explode(Separator, s: AnsiString): TStringArray;
+
function Explode(const Separator, Str: string): TStrArray;
 
</source>
 
</source>
  
Line 8: Line 8:
  
 
==Description==
 
==Description==
Splits a given [[AnsiString|string]] '''s''' into a [[TStringArray]] by breaking of at every substring given by '''Separator'''. An extended function with additional functionality is available as [[ExplodeEx]]. When '''s''' is empty, the function will return an empty array.
+
Splits a given [[string]] '''Str''' into a [[TStrArray]] by breaking of at every substring given by '''Separator'''. An extended function with additional functionality is available as [[ExplodeEx]]. When '''Str''' is empty, the function will return an empty array.
  
 
==Example==
 
==Example==

Latest revision as of 19:24, 18 October 2012

Definition

function Explode(const Separator, Str: string): TStrArray;

Availability

SCAR Divi 3.20 > Current

Description

Splits a given string Str into a TStrArray by breaking of at every substring given by Separator. An extended function with additional functionality is available as ExplodeEx. When Str is empty, the function will return an empty array.

Example

begin
  WriteLn(Implode(' ', Explode('roflcopter', 'HelloroflcopterWorld!')));
end.

Output:

Hello World!

See Also