Accessing a specific member in a F# tuple

前端 未结 4 592
南旧
南旧 2021-02-03 18:20

In F# code I have a tuple:

let myWife=(\"Tijana\",32)

I want to access each member of the tuple separately. For instance this what I want to ac

4条回答
  •  执念已碎
    2021-02-03 18:53

    You can use the function fst to get the first element, and snd to get the second ekement. You can also write your own 'third' function:

    let third (_, _, c) = c
    

    Read more here: F# Language reference, Tuples

提交回复
热议问题