tryAdd

tryAdd(value: MemberType): Boolean, lockReceiver, updating;

The tryAdd method of the Set class attempts to add the value specified in the value parameter to the set collection if it is not already present. It returns true if the value was successfully added; otherwise it returns false.

2020.0.01 and higher