mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
added 18.07
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2049 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
[[Property:title|Example: Reverse a string]]
|
||||
[[Property:weight|0]]
|
||||
[[Property:uuid|d888d308-6bb7-edd5-ee25-92d04b5658d3]]
|
||||
==Description==
|
||||
|
||||
Reverse the order of the characters in a give string of characters.
|
||||
|
||||
|
||||
==Source==
|
||||
|
||||
Problem description from [http://rosettacode.org/wiki/Reverse_a_string Rosetta Code]
|
||||
|
||||
|
||||
==Solution==
|
||||
|
||||
<code>
|
||||
class
|
||||
APPLICATION
|
||||
create
|
||||
make
|
||||
feature
|
||||
make
|
||||
-- Demonstrate string reversal.
|
||||
do
|
||||
my_string := "Hello World!"
|
||||
my_string.mirror
|
||||
print (my_string)
|
||||
end
|
||||
my_string: STRING
|
||||
-- Used for reversal
|
||||
end
|
||||
</code>
|
||||
|
||||
|
||||
==Output==
|
||||
|
||||
<code lang="text">
|
||||
!dlroW olleH
|
||||
</code>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user