2012-09-23 62 views

回答

7

使用正則表達式替代。

x.split(/[.\/]/) 
2
x = "30.04/2012" 
x.scan /\d+/ # => ["30", "04", "2012"] 
相關問題