Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > Oracle Database, SQL, Application, Programming


How to reverse strings


Reply
Views: 1485  
Thread Tools Rate Thread
  #1  
Old 08-09-2010, 01:17 PM
bholas bholas is offline
Award Winner
 
Join Date: Apr 2010
Posts: 4,977
Default How to reverse strings

Although reversing characters in a string is not a difficult task, it's always nice to have a ready made function to do that. How about something like the following:
function ReverseString( s : string )
: string;
var
i : integer;
s2 : string;
begin
s2 := '';
for i := 1 to Length( s ) do
begin
s2 := s[ i ] + s2;
end;

Result := s2;
end;

Reply With Quote
Reply

Tags
programming tips

New topics in Oracle Database, SQL, Application, Programming





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
WikiNewForum)