I'd like to easily create a list of digits from an input number using Scheme's number->string
and string->list
functions.
This will code create the list of digits I want, but with one problem: #\
will precede each digit:
(define input 1234)
(define (digit-list input)
(string->list (number->string input))
)
Running digit-list
on input
yields:
(#\1 #\2 #\3 #\4 )
How can I generate this digit list without the #\
preceding each digit?