This page is intended as a supplement to the official documentation on Delphi programming. CodeGear is in the process of putting the Delphi documentation on the Web. Once they have done so, this page will link to the relevant page in the official documentation.
This article is a stub.
Please help enhance the Delphi Programming Wiki by expanding it.
see the VCL Documentation Guidelines for an overview on doc pages



Returns the length of a null terminated string, not a Delphi string.

Technical CommentsEdit

This is not the same thing as Length(..), instead it scans the string from the pointer given until the first null character.


  s: string;
  p: PChar;
  s := 'hello';
  SetLength(s, 25);
  p := @s[1]; // get pointer to first character of string
  ShowMessage(IntToStr(Length(s))); // displays 25
  ShowMessage(IntToStr(StrLen(p))); // returns 5 

See AlsoEdit

(Please provide links to items specifically related to this item.)

User Comments/TipsEdit

(Please leave your name with your comment.)

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.