Thank you Wayne, But

(0..n-1).each do |i|
    st.insert(i,ch)
end
This is my code, st is my string. I need to insert a character, say ch.
n is 3

for example, if st = 'ab' and ch = 'c' i get:
abc
aabc
aaabc
But the desired output is
abc
bac
bca

-- 
Posted via http://www.ruby-forum.com/.