Simple Casting out nines in Ruby
number.each_char.map(&:to_i).reduce(:+)
Written by Halan Pinheiro
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#N
Authors
Related Tags
#n
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#