Phrase reversals: Difference between revisions

m
(Applesoft BASIC)
imported>Arakov
Line 901:
 
=={{header|Elena}}==
ELENA 46.x :
<syntaxhighlight lang="elena">import extensions;
import extensions'text;
Line 916:
console.printLine(reverse(phrase));
//Reverse each individual word in the string, maintaining original string order.
console.printLine(phrase.splitBy:(" ").selectBy::(s => reverse(s).add(" ")).summarize(new StringWriter()));
//Reverse the order of each word of the phrase, maintaining the order of characters in each word.
console.printLine(reverse(phrase.splitBy:(" ").selectBy::(s => s + " ")))
}</syntaxhighlight>
{{out}}
Anonymous user