String.Chars

Syntax

Chars(Index: Integer): Char;

Parameters

Index. index of character in a string. Indexing starts from 0.

Description

The Chars property returns the character with the specified index from character string.

Example

Sub UserProc;
Var
    s, s1: String;
    i, j: Integer;
Begin
    s := "String";
    // Get number of characters
    i := String.Length_(s);
    Debug.WriteLine ("Total characters: " + i.ToString);
    // Display characters in the console
    For j:=0 To i-1 Do
        s1 := s.Chars(j);
        Debug.WriteLine ("j=" + j.ToString + " character " + s1);
    End For;
End Sub UserProc;

After executing the example the console displays indexes and corresponding string characters.

See also:

String