I have a list of chars that looks like this ['a'; 'b'; '&'; 'c']. I now want to convert this into a list of strings ["a"; "b"; "&"; "c"] and not one string "ab&c" since in the end, I want to compare two lists with strings. How do I go from a list of characters to a list of strings? Thanks a lot for the help
let varL1 = ['a';'b';'&';'c']
let rec ConvertToString list =
match list with
| [l] -> l.ToString()
| head :: tail -> head.ToString() + "," + ConvertToString tail
| [] -> ""
ConvertToString varL1
I tried the code abovce but his gives me "ab&c" which is not what I am looking for. I am looking for ["a";"b";"&";"c"]
Try this.