To check whether a digit is inside an integer (ruby)

Posted by Horace Ho on Stack Overflow See other posts from Stack Overflow or by Horace Ho
Published on 2010-05-11T04:54:25Z Indexed on 2010/05/11 5:04 UTC
Read the original article Hit count: 177

Filed under:
|

Chinese people do not like numbers with a digit 4 in it. I am going to implement a membership program with membership numbers not including the digit 4, say:

number = 3
number.next.has4?
=> true

how the has4? method can be done (efficiently)?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about beginner