System.IOUtils.TFile.ReadAllLines
Delphi
class function ReadAllLines(const Path: string): TStringDynArray;
class function ReadAllLines(const Path: string;
const Encoding: TEncoding): TStringDynArray; overload; static;
C++
static System::TStringDynArray __fastcall ReadAllLines(const System::UnicodeString Path)/* overload */;
static System::TStringDynArray __fastcall ReadAllLines(const System::UnicodeString Path, System::Sysutils::TEncoding* const Encoding)/* overload */;
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | TFile |
Description
Returns the contents of a textual file as a string array.
ReadAllLines reads the contents of a textual file and returns a string array containing the retrieved text lines.
ReadAllLines, with one parameter, first reads the preamble bytes from the beginning of the Path textual file. Then
ReadAllLines skips the preamble bytes and reads the contents of the textual file beginning from this offset.
ReadAllLines returns a string array containing the text lines retrieved from the file.
If the Path file does not contain a byte order mark for one of the standard encodings, the Default standard encoding is accepted and the corresponding number of bytes is skipped.
ReadAllLines, with two parameters, first reads from the beginning of the Path textual file and skips the number of bytes corresponding to the preamble of the specified Encoding. Then ReadAllText reads the contents of the textual file beginning from this offset and returns a string array containing the text lines retrieved from the file.
ReadAllLines has the following parameters:
Pathis the path to the file.Encodingis the encoding of the text contained within thePathfile.