System.IOUtils.TFile.ReadAllLines

From RAD Studio API Documentation
Jump to: navigation, search

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

Reads the contents of a textual file into a string array.

Use ReadAllLines to read the contents of a textual file. ReadAllLines returns a new string array containing the text lines from the file. The following table lists the parameters expected by this method.



Name Meaning

Path

The path to the file.

Encoding

The encoding of the text contained within the file.



Note: ReadAllLines raises an exception if the file cannot be opened or the path is invalid.

See Also