# [Ride v5] Tuple
⚠️ This is the documentation for the Standard library version 5. We recommend to use version 6. Go to version 6
Tuple is an ordered collection of elements. Elements can be of any type. The tuple can contain from 2 to 22 elements.
The tuple is used similarly to the structure containing fields _1
, _2
, etc., where the number of fields is equal to the number of elements of the tuple.
For weight restrictions, see the Data Weight article.
# Examples
let x=("Hello Waves",42,true)
x._2
Result: 42
let (a,b,c)=x
c
Result: true
match (if true then (1, 2) else (true, "q")) {
case _: (Boolean, String) => false
case _: (Int, Int) => true
}
Result: true