RosettaCodeData/Task/Phrase-reversals/Pluto/phrase-reversals.pluto
2026-04-30 12:34:36 -04:00

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(" ")}")