ex52.pp 316 B

123456789101112131415
  1. Program Example52;
  2. { This program demonstrates the AnsiLastChar function }
  3. Uses sysutils;
  4. Var S : AnsiString;
  5. L : Longint;
  6. Begin
  7. S:='This is an ansistring.';
  8. Writeln ('Last character of S is : ',AnsiLastChar(S));
  9. L:=Longint(AnsiLastChar(S))-Longint(@S[1])+1;
  10. Writeln ('Length of S is : ',L);
  11. End.