共用方式為


ICollection.Contains(Object) Method

Definition

Returns true if this collection contains the specified element.

[Android.Runtime.Register("contains", "(Ljava/lang/Object;)Z", "GetContains_Ljava_lang_Object_Handler:Java.Util.ICollectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public bool Contains (Java.Lang.Object? o);
[<Android.Runtime.Register("contains", "(Ljava/lang/Object;)Z", "GetContains_Ljava_lang_Object_Handler:Java.Util.ICollectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Contains : Java.Lang.Object -> bool

Parameters

o
Object

element whose presence in this collection is to be tested

Returns

true if this collection contains the specified element

Attributes

Exceptions

if the object to look for isn't of the correct type.

if the object to look for is null and this Collection doesn't support null elements.

Remarks

Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that Objects.equals(o, e).

Java documentation for java.util.Collection.contains(java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to