You create PartialRangeThrough instances by using the prefix closed range operator (prefix ...).
あなたは、PartialRangeThroughインスタンスを後置範囲演算子(...)を使って作成します。
let throughFive =...5.0
You can use a PartialRangeThrough instance to quickly check if a value is contained in a particular range of values. For example:
あなたはPartialRangeThroughインスタンスを使うことで、ある値が特定の範囲に属するいくつかの値の中に含まれているかどうか素早く調べることができます。例えば:
You can use a PartialRangeThrough instance of a collection’s indices to represent the range from the start of the collection up to, and including, the partial range’s upper bound.
あなたは、あるコレクションのインデックスからなる、PartialRangeThroughインスタンスを使うことで、コレクションの始まりからこの部分範囲の上側の境界までの、そしてそれを含んでいる範囲を表すことができます。
let numbers = [10, 20, 30, 40, 50, 60, 70]print(numbers[...3])// Prints "[10, 20, 30, 40]"