From: Max Williams Date: 2009-05-28T20:31:57+09:00 Subject: making a name like "Copy of...", "Copy 2 of..." Here's a little ruby exercise - i'm a bit brain damaged today and can't think of a nice way to do this. I want a method where you pass a name as a string and it returns 'copy of x' or 'copy 2 of x' eg new_name("My Lesson") => "Copy of My Lesson" new_name("Copy of My Lesson") => "Copy 2 of My Lesson" new_name("Copy 10 of My Lesson") => "Copy 11 of My Lesson" I can only come up with horrible looking solutions but i feel there's a nice way to do it. Anyone? cheers max -- Posted via http://www.ruby-forum.com/.