What should Trim do?
Frank Heckenbach
frank at g-n-u.de
Thu Dec 13 01:41:26 CET 2001
Martin Liddle wrote:
> What should the trim function do? It seems to me that under gpc it
> removes trailing spaces from a string. Under Delphi it removes leading
> and trailing spaces. Unfortunately I don't have any Turbo Pascal
> documentation to hand (I assume trim is a Borlandism).
Nope, it's EP (6.7.6.7), and the correct behaviour is indeed to
remove only trailing spaces.
Since it's only a built-in function, not a keyword, it's easy to
overload it in a Delphi compatibility unit if someone wants Delphi's
incorrect behaviour ...
Frank
--
Frank Heckenbach, frank at g-n-u.de, http://fjf.gnu.de/
GPC To-Do list, latest features, fixed bugs:
http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
More information about the Gpc
mailing list