2012-09-23 63 views

回答

7

使用正则表达式替代。

x.split(/[.\/]/) 
2
x = "30.04/2012" 
x.scan /\d+/ # => ["30", "04", "2012"] 
相关问题