Difference between revisions of "Explode"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function Explode(Separator, s: AnsiString): TStringArray; </source> ==Availability== SCAR Divi 3.20 > Current ==Description== ...")
 
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]].
+
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.
  
 
==Example==
 
==Example==

Revision as of 10:22, 2 July 2011

Definition

function Explode(Separator, s: AnsiString): TStringArray;

Availability

SCAR Divi 3.20 > Current

Description

Splits a given 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.

Example

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

Output:

Hello World!

See Also