RosettaCodeData/Task/Reverse-a-string/AWK/reverse-a-string-1.awk
2023-07-01 13:44:08 -04:00

10 lines
143 B
Awk

function reverse(s)
{
p = ""
for(i=length(s); i > 0; i--) { p = p substr(s, i, 1) }
return p
}
BEGIN {
print reverse("edoCattesoR")
}