5 lines
275 B
Text
5 lines
275 B
Text
local s = "rosetta code phrase reversal"
|
|
print($"Input : {s}")
|
|
print($"String reversed : {s:reverse()}")
|
|
print($"Each word reversed : {s:split(" "):map(|w| -> w:reverse()):concat(" ")}")
|
|
print($"Word order reversed : {s:split(" "):reverse():concat(" ")}")
|