问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/53610214/what-is-the-difference-between-and