Write a Delphi function that reverses a string. Don't be verbose, be efficient.
- User
Write a Delphi function that reverses a string. Don't be verbose, be efficient.
Assistant
function ReverseString(const S: string): string; var I, J: integer; begin for I := 1 to Length(S) do begin J := Length(S) - 1 - I; S[I] := S[J]; S[J] := S[I]; end; end;
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.