From: Todd Benson Date: 2008-07-23T11:32:07+09:00 Subject: Re: how to capitalize a number of characters in a word On Tue, Jul 22, 2008 at 9:10 PM, Cheyne Li wrote: > Hi, there > > For example, how can i get "HelLoha" from "helloha" Here's one for fun... SEPARATION, s = 32, 'helloha' (my_letters = [0, 3]).each {|b| s[b] -= SEPARATION} puts s ...it's goofy, because I'm golfing and also trying to be descriptive at the same time :-) Of course, I'm making a large assumption that the letters to be capitalized are based on position. Here's a contrived one... include 'matrix' (Vector[*'helloha'.unpack('C*')] - Vector[1,0,0,1,0,0,0] * 32).to_a.pack('C*') ...umm, ugly. Todd