------ art_4029_5262734.1142872126962 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello World "I am puzzled".each_byte do |b| puts "%c" % b ;end Cheers Robert On 3/20/06, James Edward Gray II <james / grayproductions.net> wrote: > > On Mar 20, 2006, at 3:38 AM, Robert Klemme wrote: > > > Kev Jackson wrote: > >> Robert Klemme wrote: > >>> Lyndon Samson wrote: > >>> > >>>> a="123" > >>>> > >>>> 0.upto(a.length) { |i| puts a[i..i] } > >>> > >>> > >>> Alternatively: > >>> > >>> a.length.times {|i| puts a[i].chr} > >>> > >>> Many roads to Rome... > >>> > >>> robert > >>> > >> or even > >> a.scan(/./) { |c| p c } > > > > We had that already: your version ignores newlines. :-) > > >> require "jcode" > => true > >> "Hello\nWorld!".each_char { |chr| p chr } > "H" > "e" > "l" > "l" > "o" > "\n" > "W" > "o" > "r" > "l" > "d" > "!" > => "Hello\nWorld!" > > James Edward Gray II > > -- Deux choses sont infinies : l'univers et la bóŐise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------ art_4029_5262734.1142872126962--