On Tue  2.Dec'08 at 13:24:28 +0900, Cheryl Cepak wrote:
> I am a C++ person but trying to help a friend using Ruby.
> He is supposed to ask for user input by using an index number to change
> the letter of a word given, like say "dog".  So the user it asked to
> enter the index number, lets say 0 is entered by the user, and he then
> asks the user to put a new letter in (letter is a variable), then he
> wants to change the index of 0 which is the "D" to a "C" (where c was
> put in by the user).

my_str = "Dog"
p "Before: #{my_str}"

puts "Index?" ; i = Integer(gets)
puts "letter?"; c = gets.chomp

my_str[i] = c
puts "After: #{my_str}"

-drd