I would like to use the .NET CLR version of String.Split in F #. In particular, I would like to use this code:
let main argv = let s = "Now is the time for FOO good men to come to the aide of their country" let sepAry = [|"FOO"; "BAR"|] let z1 = s.Split sepAry 0 // return an integer exit code
However, this cannot be compiled due to the fact that the Split version in F # is implemented differently than the version in .Net 4.5. The .NET version I need is:
Split (String [], StringSplitOptions) Returns an array of strings that contains the substrings in this string that are limited to the elements of the given array of strings. The parameter specifies whether to return empty array elements.
I understand that I am getting the version of F # Split that was previously in PowerPack, and therefore the implementation is different from the CLR version.
What is the best way to get what I want? Can I override the F # Split version and use the .Net version? Is it possible to extend the version of F #, and if so, how?
source share