#!/usr/bin/env ruby # This code comes from http://ruby-it.org/pages/Iteratori+Personalizzati # Check the page for copyright notice and explanations >> stringa=" Quant'è bella giovinezza che si fugge tuttavia! Chi vuol esser lieto, sia: di doman non c'è certezza. " => "\nQuant'è bella giovinezza\nche si fugge tuttavia!\nChi vuol esser lieto, sia:\ndi doman non c'è certezza.\n" >> puts stringa.sort #lavora con each, quindi con le linee Chi vuol esser lieto, sia: Quant'è bella giovinezza che si fugge tuttavia! di doman non c'è certezza. => nil >> require 'enumerator' => true >> e=Enumerable::Enumerator.new( stringa, :each_byte => # >> e.min => 10 >> e + 'miao' NoMethodError: undefined method `+' for # from (irb):17