On Mon 20 Feb 2012 19:51, Catonano <caton...@gmail.com> writes: > I'd love to split a url string. Is there a function I am supposed to use ? In > which module ? > > that is > > "...blah/blah?param1=1234&param2=5678"
Use (web uri). Specifically string->uri and uri-query. Once you have the query string, you can pick apart the pieces with something like this: (define* (parse-www-form-urlencoded str #:optional (charset "utf-8")) (map (lambda (piece) (let ((equals (string-index piece #\=))) (if equals (cons (uri-decode (substring piece 0 equals) #:encoding charset) (uri-decode (substring piece (1+ equals)) #:encoding charset)) (cons (uri-decode piece #:encoding charset) "")))) (string-split str #\&))) Andy -- http://wingolog.org/