summaryrefslogtreecommitdiff
path: root/fpcdocs/sysutex/ex52.pp
blob: 60209541748d9ea810bbd54593ac8a44fd45f647 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Program Example52;

{ This program demonstrates the AnsiLastChar function }

Uses sysutils;

Var S : AnsiString;
    L : Longint;

Begin
  S:='This is an ansistring.';
  Writeln ('Last character of S is : ',AnsiLastChar(S));
  L:=Longint(AnsiLastChar(S))-Longint(@S[1])+1;
  Writeln ('Length of S is : ',L);
End.