From: Love U Ruby Date: 2013-05-08T20:47:01+09:00 Subject: Recursion is not working well Hi, I wrote a recursion as follows: s = :split_this_world_game def brk(start,s) ar = [] cp = (s =~ /[_]/) ss = s[start + 1,cp] if cp != nil return s if cp == nil ar.push(ss) return ar.push(brk(cp,s[cp+1,s.size - ss.size])).flatten end p brk(-1,s) The above code output: ["split", "orld", "_game", "game"] But I wanted it as : ["split","this","world","game"] Can anyone help me to find out where I did the wrong? -- Posted via http://www.ruby-forum.com/.