CSet:Remove


The Remove method removes a member from the CSet by matching its value to a set member.

Syntax

member = CSet:Remove( value )

where

    value specifies the member to remove.

    member is the set member that was removed. On failure, nil is returned.

  

This method finds the member in the list by searching the list to match its value. On success, the value argument and the returned member should be equal. Removing a set member decreases the Count by 1 but does not delete the member.

Example

Suppose a CSet exists with name S and that it contains 10 strings. The following script removes from the list the string "ABC""

Printf("count=%d", S:Count())

-- result: count=10

S:Remove( "ABC" )

-- remove the member at index 5

Printf("count=%d", S:Count())

-- result: count=9

Related Topics

RemoveAt

RemoveFirst

RemoveLast

CSet class