typo
typo

Reputation: 389

What is the difference between .. and ...?

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

Answers (1)

ljedrz
ljedrz

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

Related Questions