A range-replaceable collection. 範囲置換可能なコレクション。
Generic Operator+(_:
+(_:_:)
Creates a new collection by concatenating the elements of two collections.
2つのコレクションの要素を連結することによって新しいコレクションを作成します。
Availability 有効性
- iOS 15.0+
- iPadOS 15.0+
- macOS 12.0+
- Mac Catalyst 15.0+
- tvOS 15.0+
- watchOS 8.0+
- Xcode 13.0+
Technology
- Foundation ファウンデーション
Declaration 宣言
static func + <Other>(lhs: AttributedString
.UnicodeScalarView
, rhs: Other) -> AttributedString
.UnicodeScalarView
where Other : RangeReplaceableCollection
, UnicodeScalar
== Other.Element
Parameters パラメータ
lhs
rhs
Another range-replaceable collection. 別の範囲置換可能なコレクション。
Discussion 議論
The two arguments must have the same Element
type. For example, you can concatenate the elements of two integer arrays.
2つの引数は、同じElement
型を持たなければなりません。例えば、あなたは2つの整数配列の要素それらを連結できます。
let lowerNumbers = [1, 2, 3, 4]
let higherNumbers: ContiguousArray = [5, 6, 7, 8, 9, 10]
let allNumbers = lowerNumbers + higherNumbers
print(allNumbers)
// Prints "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
The resulting collection has the type of the argument on the left-hand side. In the example above, more
has the same type as numbers
, which is [Int]
.
結果のコレクションは、左手側での引数の型を持ちます。上の例では、more
はnumbers
と同じ型を持ちます、それは[Int]
です。