Tokenize a string: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,152: | Line 1,152: | ||
=={{header|Scala}}== |
=={{header|Scala}}== |
||
<lang scala>println("Hello,How,Are,You,Today" split "," mkString ".")</lang> |
<lang scala>println("Hello,How,Are,You,Today" split "," mkString ".")</lang> |
||
=={{header|Scheme}}== |
|||
{{works with|Guile}} |
|||
<lang scheme>(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 ".")))</lang> |
|||
=={{header|Seed7}}== |
=={{header|Seed7}}== |