white-space-char-list - Applications of string-of-char-list?. | Lecture 3 - slide 23 : 42 Program 1 |
;; A list of characters considered as blank space characters (define white-space-char-list (list #\space (as-char 13) (as-char 10) #\tab)) ;; Is the string str empty or blank (consists of white space) (define (blank-string? str) (or (empty-string? str) (string-of-char-list? str white-space-char-list))) ;; Returns if the string str is numeric. ;; More specifically, does str consist exclusively of the ;; ciffers 0 through 9. (define (numeric-string? str) (string-of-char-list? str (list #\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 )))