Concatenate string to integer in Ocaml
concatenation, integer, ocaml, string
Solution
As you undoubtedly noticed, you can only concatenate strings with other strings - not integers. So you'll have to convert your integer to a string before you can concatenate it. If the integer is really hard coded like in your example, you can just write `"0"` instead of `0` (in fact in your example you can just write `"a0"` and not concatenate anything at all).
If the integer is not a constant, you can use `string_of_int` to convert it to a string. So this will work:
let x = "a" ^ string_of_int my_integer
Problem
I would like a working version of this: ``` let x = "a" ^ 0;; ```