From: Michal Date: 2005-11-28T03:03:01+09:00 Subject: Re: getting character(s) of a string at specified positions. Hi, > "How much wood would a wood-chuck chuck if a wood-chuck could chuck wood" > > I would find that the character there is "m". > > How would I find the fifth character? irb(main):001:0> a="How much wood would a wood-chuck chuck if a wood-chuck could chuck wood" => "How much wood would a wood-chuck chuck if a wood-chuck could chuck wood" irb(main):002:0> a[4,1] => "m" M. -- # Michal Safranek, email: a=(("a".."z").to_a+["@","."]);p(("%b"%[0x645bbb83a6a496] ).scan(/...../).map{|x|a[Integer("0b"+x)]}.join.reverse)