StrToTEA

From SCAR Divi Manual
Revision as of 10:32, 30 April 2012 by Freddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function StrToTEA(const Str: string): TExtArray;

Availability

SCAR Divi 3.34 > Current

Description

Converts a string matching/containing the regex \d+(?:\.\d+)?(?:E\d+)? to a TExtArray. The regex allows for a lot of flexibility when it comes to the format of the entered string. The TExtArray can be converted back to a string with TEAToStr.

Example

begin
  WriteLn(TEAToStr(StrToTEA('1,2.8,3')));
  WriteLn(TEAToStr(StrToTEA('Hello1.7,2.1,3World')));
  WriteLn(TEAToStr(StrToTEA('1 ,2E8 3')));
  WriteLn(TEAToStr(StrToTEA('1.1e9a2b3')));
end.

Output:

1,2.8,3
1.7,2.1,3
1,200000000,3
1100000000,2,3

See Also