System.IOUtils.TFile.ReadAllLines

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

class function ReadAllLines(const Path: string): TStringDynArray;
class function ReadAllLines(const Path: string;  const Encoding: TEncoding): TStringDynArray; overload; static;

C++

static System::DynamicArray<System::UnicodeString> __fastcall ReadAllLines(const System::UnicodeString Path)/* overload */;
static System::DynamicArray<System::UnicodeString> __fastcall ReadAllLines(const System::UnicodeString Path, System::Sysutils::TEncoding* const Encoding)/* overload */;

プロパティ

種類 可視性 ソース ユニット
function public
System.IOUtils.pas
System.IOUtils.hpp
System.IOUtils TFile

説明

テキスト ファイルの内容を読み取って文字列配列に格納します。

テキスト ファイルの内容を読み取るには ReadAllLines を使用します。ReadAllLines は、ファイルから読み取ったテキスト行を含む新しい文字列配列を返します。このメソッドに必要なパラメータの一覧を以下の表に示します。



名前 意味

Path

ファイルのパス。

Encoding

ファイル内に含まれているテキストのエンコーディング。



メモ:  ファイルを開けない場合やパスが無効な場合、ReadAllLines は例外を発生させます。

関連項目