DelphiFAQ Home Search:
General :: Programming :: Delphi :: Strings
Algorithms for string handling problems, implemented in Delphi but useful for any procedural language.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Is PChar(string) ok?

Q: Is it ok to cast a string to a pchar?

A: Yes. Delphi long strings (the default string type in 32-bit Delphi) are designed specifically to allow typecasting to PChar.

The following code is valid (with Delphi 2/3/4):

procedure p;
   s : string;
   s := 'Hello world';
   // set the current window's caption
   SetWindowText (GetActiveWindow, PChar(s));

Generated 4:01:16 on Apr 6, 2020