I need to convert all the even indexed characters in a string to become uppercase, while the odd indexed characters stay lowercase. I've tried this, but it keeps failing and I'm not sure why. I'd appreciate some help!
for i in 0..string.length if (i % 2) == 0 string[i].upcase else string[i].downcase end end