Jump to content

Reverse words in a string: Difference between revisions

m
added whitespace before the TOC, added an ;Example (bold) header, made a verb agree in number.
(Added Algol 68)
m (added whitespace before the TOC, added an ;Example (bold) header, made a verb agree in number.)
Line 1:
{{task}}
The task is to reverse the order of all tokens in each of a number of strings and display the result;   the order of characters within a token should not be modified.
: '''Example:''' &nbsp; “<tt>Hey you, Bub!</tt>” &nbsp; would be shown reversed as: &nbsp; “<tt>Bub! you, Hey</tt>”
 
 
Tokens are any non-space characters separated by spaces (formally, white-space); &nbsp; the visible punctuation forms part of the word within which it is located and should not be modified.
;Example:
: '''Example:''' &nbsp; “<tt>Hey you, Bub!</tt>” &nbsp; would be shown reversed as: &nbsp; “<tt>Bub! you, Hey</tt>”
 
Tokens are any non-space characters separated by spaces (formally, white-space); &nbsp; the visible punctuation formsform part of the word within which it is located and should not be modified.
 
You may assume that there are no significant non-visible characters in the input. &nbsp; Multiple or superfluous spaces may be compressed into a single space.
Line 12 ⟶ 15:
 
(You can consider the ten strings as ten lines, and the tokens as words.)
 
 
;Input data
Line 33 ⟶ 37:
;Cf.
* [[Phrase reversals]]
<br><br>
 
=={{header|Ada}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.