Anonymous user
Phrase reversals: Difference between revisions
→{{header|Elena}}
(added a solution for Factor) |
|||
Line 701:
</lang>
=={{header|Elena}}==
ELENA 3.
<lang elena>import extensions.
import system'routines.
program =
[
var reverse := (:s)(s toArray; sequenceReverse; summarize(String new)).
var phrase := "rosetta code phrase reversal".
console printLine(phrase).
//Reverse the string
console printLine(reverse
//Reverse each individual word in the string, maintaining original string order.
console printLine(phrase split by:" "; selectBy(:s)(reverse
//Reverse the order of each word of the phrase, maintaining the order of characters in each word.
console printLine(reverse
].</lang>
{{out}}
|