s = 'jeep/grand cherokee////////hyundai/////harley davidson//bmw'p s.gsub(/\/{3,}/, '//')
Standard input is empty
"jeep/grand cherokee//hyundai//harley davidson//bmw"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!