System.SysUtils.TStringHelper.Chars

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

Delphi

property Chars[Index: Integer]: Char read GetChars;

プロパティ

種類 可視性 ソース ユニット
property public System.SysUtils.pas System.SysUtils TStringHelper


説明

この 0 基準の文字列の個々の文字へアクセスします。Chars プロパティは読み取り専用です。文字列の外側の文字にアクセスした場合(文字列の長さが1より大きいか、ゼロより小さい場合)、または文字列が空の場合、この関数は未定義の結果を返します。

var
  I: Integer;
  MyString: String;

begin
  MyString := 'This is a string.';

  for I:= 0 to MyString.Length - 1 do
    Write(MyString.Chars[I]);
end.

出力:


This is a string.

関連項目