在悉尼,移动端的字符串仍然为零吗?

In Sydney does string still zero based in mobile?

当我阅读文档时:http://docwiki.embarcadero.com/RADStudio/Sydney/en/Migrating_Delphi_Code_to_Mobile_from_Desktop 说移动字符串是基于 0 的,但我听说情况不再如此,所以文档不准确吗?

"..so is the doc inaccurate ?"

是的,您正在阅读的文档没有更新最新信息。

参见Zero-based strings

Compilers (desktop and mobile) have as predefined {$ZEROBASEDSTRINGS OFF} indicating the use 1-based string indexes.

Note: Previous to Delphi 10.4 the mobile compilers used by default 0-based indexing for strings.

您仍然可以通过设置 {$ZEROBASEDSTRINGS ON}

使用从零开始的字符串

也来自文档:

In general terms, string indexing is now uniform across platforms and uses 1-based index model.

Notice however that:

  • Delphi string type helpers (TStringHelper) remain 0-based.
  • All Delphi global flat functions are 1-based.

文档有几个地方不准确:https://quality.embarcadero.com/browse/RSP-31133