s = "more.name.stl"puts s.sub(/\.[^.]+\z/, '')puts s.rpartition('.').first
Standard input is empty
more.name more.name
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!