V2 string

Walter Bright newshound1 at digitalmars.com
Thu Jul 5 11:36:02 PDT 2007


Regan Heath wrote:
> Walter Bright Wrote:
>> string fullpath;
>>
>> fullpath = CanonicalPath(shortname);
>> version(Windows)
>> {
>>        fullpath = std.string.tolower(fullpath);
>> }
>>
>> you won't need to do the .dup .
> 
> Because tolower does it for you, but it still returns string

tolower only dups the string if it needs to. It won't dup a string that 
is already in lower case.

 > and if for example
 > you need to add something to the end of the path, like a filename you 
 > will end up
 > doing yet another dup somewhere.

Concatenating strings does not require a .dup.



More information about the Digitalmars-d mailing list