Is there a syntactically cleaner way to preform a case insensitive string comparison in F# than the following
System.String.Equals("test", "TeSt", System.StringComparison.CurrentCultureIgnoreCase)
Also, you can use F# type extensions mechanics:
> type System.String with
- member s1.icompare(s2: string) =
- System.String.Equals(s1, s2, System.StringComparison.CurrentCultureIgnoreCase);;
> "test".icompare "tEst";;
val it : bool = true
How about writing an extension method to make this shorter.
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