TStringHelper is not returning the correct results
delphi, delphi-xe4
Solution
This is because all the methods and properties of the System.SysUtils.TStringHelper are zero based index, this helper was compiler with the {$ZEROBASEDSTRINGS ON} directive. you can find more info in the System.SysUtils.TStringHelper documentation.
Problem
I'm using the `TStringHelper` in a Win32 Application, but when I try to access a particular char or get a substring the values returned are not the same If I use the equivalent old string functions. ``` {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; var i : Integer; s : string; begin try i:=12345678; Writeln(i.ToString().Chars[1]); // returns 2 Writeln(i.ToString().Substring(1)); //returns 2345678 s:=IntToStr(i); Writeln(s[1]); //returns 1 Writeln(Copy(s,1,Length(s)));//returns 12345678 except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end. ``` The question is Why the TStringHelper functions are not equivalent to the old string functions?