Script Name: Text Flipper
Script Description: Flips the string (so left becomes right) between two specified locations within a string
Original Author: Curt (DorkeyDear)
Core Version: 2.6.1b
Code: function Flip(Text: string; First, Last: integer): string;
var
i: integer;
Build: string;
begin
for i := Last downto First do begin
Build := Build + Text[i];
end;
Result := Copy(Text,1,First - 1) + Build + Copy(Text,Last + 1,Length(Text));
end;
Example: Flip('abcdefg',2,6) results 'afedcbg'