Notice

The forum is in read only mode.

  • Page:
  • 1

TOPIC: UnicodeString - substring

UnicodeString - substring 6 years 4 months ago #2127

Substring return different values on different platforms!
Do i need to use #pragma for substring on different platforms or it is a bug?

UnicodeString t = "abc";
int l = t.Length();
UnicodeString t1 = t.SubString(1,t.Length());

On windows 64 bit:
l=3
t1= „abc“

On ios 32 bit
l=3
t1=“bc“

UnicodeString - substring 6 years 4 months ago #2152

On mobile platforms strings are zero based by default. You can change that using {$ZEROBASEDSTRINGS OFF} compiler directive

docwiki.embarcadero.com/RADStudio/XE8/en...strings_%28Delphi%29

UnicodeString - substring 6 years 4 months ago #2157

I have tested above code in Delphi XE7, but I get same results (t1=bc) in all platforms.

Is delphi handling this automatically?
  • Page:
  • 1
Moderators: April Anne