Description
The concat function is used to concatenate various Core Foundation (CF) and Foundation framework types.
Initially designed for CFStrings, it supports a variety of types, including CFAttributedString, CFArray, CFDictionary, CFSet, NSOrderedSet, NSIndexSet, and NSCountedSet.
Additionally, the function supports concatenation of mixed types in specific combinations.
Use the concat keyword followed by the objects to be concatenated, separated by comma ','.
Syntax 2 returns a string with the objects joined by joinStr. This is similar to the function, ArrayComponentsJoinedByString.
Mixed Type Concatenation
The concat function also supports concatenation of the following mixed type combinations:
CFArray + CFString
Adds a CFString, as an element, to a CFArray.
CFString + CFArray
Appends the elements of a CFArray to a CFString.
CFArray + CFSet
Concatenates the contents of a CFSet to a CFArray.
CFSet + CFArray
Concatenates the contents of a CFArray to a CFSet.
CFArray + IndexSet
Adds the contents of an IndexSet (as CFNumbers) to a CFArray.
Note: When mixing types, the first object in the list determines the returned object type. For example, if obj1 is a CFString, newObj will also be a CFString.