From: Joel Pearson Date: 2013-07-08T22:34:11+09:00 Subject: Re: How can I make ruby read a string of characters per three characters? Here's an example which will let you put in sets of 3 characters and rollaround anything which doesn't fall into a group of 3. This particular script just puts the ASCII character, so you're limited to passing character groups between "000" and "255" as input (or a fatal error occurs). _________ leftover = '' loop do puts 'Enter Numbers:' input = gets.chomp unless leftover.empty? input = leftover + input leftover = '' end input.scan(/.{1,3}/) do |s| if s.length == 3 puts s.to_i.chr else leftover = s end end #input scan end #loop -- Posted via http://www.ruby-forum.com/.