Sign in Join
FPDoc Onlineexperiment

strlen function

In unit Strings

Length of a null-terminated string.

Declaration

pascal
function strlen(p: PAnsiChar): SizeInt

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.