System.SysUtils.TStringHelper.Chars
Delphi
property Chars[Index: Integer]: Char read GetChars;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | System.SysUtils.pas | System.SysUtils | TStringHelper |
Description
Accesses individual characters in this zero-based string. The Chars property is read-only. If you access a character outside the string (more than string lenght-1 or less than zero), or if the string is empty, then this function returns an undefined result.
var
I: Integer;
MyString: String;
begin
MyString := 'This is a string.';
for I:= 0 to MyString.Length - 1 do
Write(MyString.Chars[I]);
end.
Output:
This is a string.