[Newbies] crossSum

Bert Freudenberg bert at impara.de
Tue May 9 16:21:30 UTC 2006


Am 09.05.2006 um 16:46 schrieb Ron Teitelbaum:

> Integer>> crossSum
> 	"return to the sender the sum of each decimal digit of self"
> 	^self asString detectSum: [:a | a asString asInteger]

Mind that
	
	a digitValue

would be a better alternative to
	
	a asString asInteger

- Bert -



More information about the Beginners mailing list