c# - Conditional Operator in F# (A?B:C) -
this question has answer here:
- does f# have ternary ?: operator? 4 answers
in c#, have conditional operator:
[condition] ? [value if true] : [value if false]
but can't seem find in f#. exist?
as found here answer is
c# has ternary operator "?:" conditional expressions:
condition ? trueval : falseval
f# has same operator, name if-then-else:
if condition trueval else falseval
(note "if" used less in f# in c#; in f#, many conditionalexpressions done via pattern-matching rather if-then-else.)
the website linked offers bunch of c# vs f# examples.
Comments
Post a Comment