diegoaguilar
diegoaguilar

Reputation: 8376

Are string and String (case change) the same in Delphi?

Are they something like the primitive and the class type one, each?

For

function binaryFormat (binary:String; n:Integer) : String;

and

function binaryFormat (binary:String; n:Integer) : string;

would their result values be the same?

Upvotes: 0

Views: 958

Answers (2)

mjn
mjn

Reputation: 36654

In Delphi, the built-in types usually start with a capital letter, and I have seen a lot of Delphi code where String is used, as if there was a type with this name. But this is wrong, there is no String type (with a capital first letter) - so String is just a spelling error.

The correct spelling is string (all lower case), and it is an alias for UnicodeString (in Delphi 2009 and up), see http://docwiki.embarcadero.com/RADStudio/XE3/en/String_Types

Upvotes: 6

Ken White
Ken White

Reputation: 125708

Delphi is not case-sensitive, so string, STRING, stRIng and String are all the same.

I referred you to a Pascal tutorial in a previous question. Please use it.

Upvotes: 9

Related Questions