ruby-uebungen/Assignment_040/solution/readme.md

13 lines
496 B
Markdown

# Lösung: Singleton Methoden
<div style="border: 1px solid grey;"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div>```ruby
s1 = "Hallo"
s2 = "Welt"
def s2.to_leet
self.tr('aeiou', '43107')
end
puts s2.to_leet
```