Reverse a string: Difference between revisions

Add Draco
(Add Miranda)
(Add Draco)
Line 1,192:
end;</syntaxhighlight>
All versions has the same perfomance, then StrUtils is recomended.
 
=={{header|Draco}}==
<syntaxhighlight lang="draco">/* Reverse string in place */
proc nonrec reverse(*char s) void:
*char e;
char t;
e := s;
while e* /= '\e' do
e := e + 1
od;
while
e := e - 1;
s < e
do
t := e*;
e* := s*;
s* := t;
s := s + 1
od
corp
 
proc nonrec main() void:
*char testString = "!dlrow ,olleH";
reverse(testString);
writeln(testString)
corp</syntaxhighlight>
{{out}}
<pre>Hello, world!</pre>
 
=={{header|DWScript}}==
2,096

edits