Exposes the properties of the GParser.TGCustomParser class), it tokenizes a string by parsing a string for a series of tokens separated by Delimiters (such as spaces).
Namespace: GParser
The following example uses the TGParser class to parse a string of numbers and add the numbers up (delimiters are spaces):
Delphi
|
var
Parser: TGParser;
begin
Parser := TGParser.Create( '10.5 123 40.3 56 70.1 89.2' );
try
result := 0;
if Parser.First then
repeat
result := Result + StrToFloat(Parser.Token);
until not Parser.Next;
finally
Parser.Free;
end;
end;
|
|