Sign in Join
FPDoc Onlineexperiment

StrLen function

In unit sysutils

Length of a null-terminated string.

Declaration

pascal
function StrLen(p: PAnsiChar): SizeInt; overload

Description

Returns the length of the null-terminated string P. If P equals Nil then zero (0) is returned.

Errors

None.

See also

Example: ex1

pascal
Program Example1;

Uses strings;

{ Program to demonstrate the StrLen function. }

Const P : PChar = 'This is a constant pchar string';

begin
  Writeln ('P         : ',p);
  Writeln ('length(P) : ',StrLen(P));
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.