Short version -- How do I do Python rsplit() in ruby?
Longer version -- If I want to split a string into two parts (name, suffix) at the first \'.\' character, this
Here's what I'd actually do:
/(.*)\.(.*)/.match("what.to.do")[1..2] => ["what.to", "do"]
or perhaps more conventionally,
s = "what.to.do" s.match(/(.*)\.(.*)/)[1..2] => ["what.to", "do"]