Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created September 18, 2013 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/6609618 to your computer and use it in GitHub Desktop.
Save jpluimers/6609618 to your computer and use it in GitHub Desktop.
ZEROBASEDSTRINGS
procedure ZeroBasedTest;
const
S: string = '012';
begin
{$ZEROBASEDSTRINGS OFF}
Writeln(S[1]); // shows "0"
Writeln(S.Chars[1]); // shows "1"
{$ZEROBASEDSTRINGS ON}
Writeln(S[1]); // shows "1"
Writeln(S.Chars[1]); // shows "1"
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment