ruby-uebungen/Assignment_045/solution/readme.md

13 lines
496 B
Markdown
Raw Permalink Normal View History

2023-05-23 09:19:31 +02:00
# 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
```