Menu

ExtractTextColumn

Krzysztof Kamil Jacewicz

[ATUlib]: ExtractTextColumn

A version of a standard Object Pascal FreeAndNil function for freeing and objects and setting its pointer to nil, that catches runtime exceptions.

Function header

Function  ExtractTextColumn(s: string; const AIndex: cardinal): string;

Parameters

  • s - specifies a source string to have a specific column extracted from
  • AIndex - indicates which column is to be extracted form the specified string. This index starts from zero, so the first column is indexed by value of 0.

Result

Returns substring belonging to the specified column in the passed string, or an empty string if the specified column index is invalid.

Example

var
  s : string = 'I like pizze so so very much!';
(..)
begin
  writeln(ExtractTextColumn(0)); //will print 'I'
  writeln(ExtractTextColumn(2)); //will print 'pizza'
  writeln(ExtractTextColumn(6)); //will print 'much!'
end;

Related

Wiki: ATUlib

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.