I'm quite new in F#.
I guess arrays are still collections, so I could use Seq for iterating the array like this:
[|"a"; "b"|] |> Seq.map (fun f -> printfn "a") |> ignore;;
But that doesn't work - it prints nothing.
On the other hand if I use Array, it prints the strings:
[|"a"; "b"|] |> Array.map (fun f -> printfn "a") |> ignore;;
Why is that?
printffunction properly here,printfn "a"only prints string "a". If you want to print any value you have to useprintfn "%A" anyValue. See Printf module for all possible formating markers (%): msdn.microsoft.com/en-us/library/ee370560.aspx - Stringerstring.Format(it doesn't care if you pass some arguments in, sostring.Format("{0}", 'a') works andstring.Format("a")` works too. Simply - I wasn't looking for the right command. Thx :) - stej