Chars(Index: Integer): Char;
Index. index of character in a string. Indexing starts from 0.
The Chars property returns the character with the specified index from character string.
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: