Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> lower = "`" # predecessor of 'a'
- => "`"
- >> letters = []
- => []
- >> 10.times { letters << lower.succ! }
- => 10
- >> letters
- => ["j", "j", "j", "j", "j", "j", "j", "j", "j", "j"]
- # But
- >> letters.clear
- => []
- >> lower = "a"
- => "a"
- >> 10.times { letters << lower; lower = lower.succ }
- => 10
- >> letters
- => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
Add Comment
Please, Sign In to add comment