Difference between revisions of "StrToTIA"

From SCAR Divi Manual
Jump to: navigation, search
(Definition)
 
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function StrToTIA(const Str: AnsiString): TIntArray;
+
function StrToTIA(const Str: string): TIntArray;
 
</source>
 
</source>
  
Line 8: Line 8:
  
 
==Description==
 
==Description==
Converts a [[AnsiString|string]] matching/containing the regex \d+ to a [[TIntArray]]. The regex allows for a lot of flexibility when it comes to the format of the entered string. The TIntArray can be converted back to a string with [[TIAToStr]].
+
Converts a [[string]] matching/containing the regex \d+ to a [[TIntArray]]. The regex allows for a lot of flexibility when it comes to the format of the entered string. The TIntArray can be converted back to a string with [[TIAToStr]].
  
 
==Example==
 
==Example==

Latest revision as of 11:30, 30 April 2012

Definition

function StrToTIA(const Str: string): TIntArray;

Availability

SCAR Divi 3.25 > Current

Description

Converts a string matching/containing the regex \d+ to a TIntArray. The regex allows for a lot of flexibility when it comes to the format of the entered string. The TIntArray can be converted back to a string with TIAToStr.

Example

begin
  WriteLn(TIAToStr(StrToTIA('1,2,3')));
  WriteLn(TIAToStr(StrToTIA('Hello1,2,3World')));
  WriteLn(TIAToStr(StrToTIA('1 ,2 3')));
  WriteLn(TIAToStr(StrToTIA('1a2b3')));
end.

Output:

1,2,3
1,2,3
1,2,3
1,2,3

See Also