Tokenize a string: Difference between revisions
Content added Content deleted
m (→[[Pop11]]) |
|||
Line 244: | Line 244: | ||
;;; If comma |
;;; If comma |
||
if str(i) = `,` then |
if str(i) = `,` then |
||
;;; |
;;; Prepend word (substring) to list |
||
cons(substring(j, i - j, str), ls) -> ls; |
cons(substring(j, i - j, str), ls) -> ls; |
||
i + 1 -> j; |
i + 1 -> j; |
||
endif; |
endif; |
||
endfor; |
endfor; |
||
;;; |
;;; Prepend final word (if needed) |
||
if j <= length(str) then |
if j <= length(str) then |
||
cons(substring(j, length(str) - j + 1, str), ls) -> ls; |
cons(substring(j, length(str) - j + 1, str), ls) -> ls; |