I need use match
to check if a value is an array of strings or a string. I've tried something in the vain of
| :? string[] -> ..
| :? string -> ..
| :? array<string[]> -> ..
but invain.
Any help?
You need to modify the syntax slightly, but you were almost correct
let fn (arg:obj) =
match arg with
| :? string as str -> printfn "string"
| :? (string[]) as arr -> printfn "string array"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With