RosettaCodeData/Task/Tokenize-a-string/Scheme/tokenize-a-string-1.ss

9 lines
279 B
Scheme
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
(use-modules (ice-9 regex))
(define s "Hello,How,Are,You,Today")
(define words (map match:substring (list-matches "[^,]+" s)))
(do ((n 0 (+ n 1))) ((= n (length words)))
(display (list-ref words n))
(if (< n (- (length words) 1))
(display ".")))