1
vote
Vote UpVote

Delphi - always full of surprises!

The Delphi Geek – After all these years, Delphi still surprises me. Apparently, as I found out today (by making a stupid typo), Copy(string, index, position) doesn't require position parameter!IOW, following two lines do exactly the same:s := Copy('123456789', 4, 6);s := Copy('123456789', 4);Works for arrays, too!Of course, this is not documented.See for yourself:program ProjectCopy;{$APPTYPE CONSOLE}{$R *.res}uses  SysUtils;var  s1: TArray;begin  Writeln(Copy('123456789', 4, 6));  Writeln(Copy('123456789', 4));  s1 := ['1', '2', '3'];  Writeln(string.Join(',', Copy(s1, 1, ...
Favorite? Off-Topic? Primož Gabrijelčič @ 2018-06-20 12:15

Statistics

Visits: 321
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)