RosettaCodeData/Task/Reverse-a-string/Lingo/reverse-a-string-2.lingo

9 lines
162 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
on reverseBytes (str)
ba = byteArray(str)
res = byteArray()
repeat with i = ba.length down to 1
res[res.length+1] = ba[i]
end repeat
return res
end