JCL Help:StrReverse@AnsiString

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Reverses a string.


Pascal

 function StrReverse(const S: string): string;
function StrReverse(const S: AnsiString): AnsiString;


Parameters

Parameters Description
const S: string The string to reverse.


Return Value

A reversed copy of the supplied string.


Description

StrReverse returns a reversed copy of S. That is, if you pass in 'Delphi' the function result will be 'ihpleD'. Note that the original string remains unmodified, as the const modifier indicates. If you don't need the original string after reversing it, then do not write code like S := StrReverse(S) but instead use the StrReverseInPlace function because it's much faster.


See Also

StrReverseInPlace


About

Unit

JclAnsiStrings


Donator

Marcel van Brakel


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page