Front-End/Ruby
Ruby - String에서 Number성분만 추리기
리나그(ReenAG)
2021. 12. 29. 19:46
728x90
반응형
https://stackoverflow.com/questions/2640819/extract-number-from-string-in-ruby/59238529
Extract number from string in Ruby
I'm using this code: s = line.match( /ABCD(\d{4})/ ).values_at( 1 )[0] To extract numbers from strings like: ABCD1234 ABCD1235 ABCD1236 etc. It works, but I wonder what other alternative I h...
stackoverflow.com
그중에서
line.delete("^0-9")
이게 제일 간단하고 좋아보임!
728x90
반응형