list class : Remove(class) method

Description

Removes the first element equal to the arguments from the list.

Syntax

listInstance.Remove(someClass removedInstance)

Arguments

ClassNameDescription
someClassremovedInstanceInstance to be removed.

Return value

ClassDescription
boolA value that indicates whether this method succeeded.

Sample code

//anyList is a instance of list{string} type.

//someString is a instance of string type.

bool success = anyList.Remove(someString);

Notes

It's a wrapper of the System.Collections.Generic.List<t>.Remove(T).

Returns true if the removing succeeds; otherwise, returns false.

This method compare equivalence as references. Please note that do not compare equivalence as value.

Links for reference

Copyright © Rice All rights reserved.