Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 527

How to append to string in ocaml?

$
0
0

I don't know how to add some string to itself in loop.

let parameters = [| [| ("name", "fdjks"); ("value", "dsf") |]; [| ("name", "&^%"); ("value", "helo") |] |] ;;let boundary = "----WebKitFormBoundary7MA4YWxkTrZu0gW";;let body = "";;for x = 0 to (Array.length(parameters) : int)-1 do    let (_, paramName) = parameters.(x).(0) in    let (_, paramValue) = parameters.(x).(1) in    body = body ^ "--" ^ boundary ^ "\r\n" ^ "Content-Disposition:form-data; name=\"" ^ paramName ^ "\"\r\n\r\n" ^ paramValue ;    print_endline(body)done;;

but this gives error..Any way to do this......?


Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>