Extract number from string in Ruby

后端 未结 7 2103
既然无缘
既然无缘 2020-12-02 10:59

I\'m using this code:

s = line.match( /ABCD(\\d{4})/ ).values_at( 1 )[0] 

To extract numbers from strings like:

ABCD1234
AB         


        
7条回答
提交回复
热议问题