Reputation: 6586
Is there an easy way to convert a char[] to string in F# without explicitly looping over the array? I tried:
let char_arr = [|'a','b','c'|]
let str = new String(char_arr)
but that doesn't work. Suggestions?
Upvotes: 0
Views: 3265
Reputation: 2220
The array elements are separated by ';'
let char_arr = [|'a';'b';'c'|]
let str = new string(char_arr)
str |> printfn "%A"
Link: http://ideone.com/scp7qb
Upvotes: 5