Reputation: 389
The title is pretty much self-explanatory: When should one use the double-dots ..
and when the triple-dots ...
? Both are used to indicate a range.
Upvotes: 11
Views: 2165
Reputation: 22203
While ranges with double dots don't include the end bound, triple dots were used for inclusive ranges, i.e. (0...2)
would contain 2
as well. This is now obsolete; use ..=
for this purpose instead.
Upvotes: 19