Phrase reversals: Difference between revisions

m
→‎{{header|Java}}: Typign is hard, OK?
(+Java, not as concise as the others :()
m (→‎{{header|Java}}: Typign is hard, OK?)
Line 52:
String str = "rosetta code phrase reversal";
System.out.println("StriaghtStraight-up reversed: " + reverse(str));
String[] words = str.split(" ");
for(int i = 0; i < words.length; i++){
Line 62:
}</lang>
{{out}}
<pre>StriaghtStraight-up reversed: lasrever esarhp edoc attesor
Reversed words: attesor edoc esarhp lasrever
Reversed word order: reversal phrase code rosetta</pre>
 
=={{header|Python}}==
<lang python>>>> phrase = "rosetta code phrase reversal"
Anonymous user