語言

ICollection.RemoveIf(IPredicate) 方法

定義

移除該集合中所有滿足該謂詞的元素(可選操作)。

[Android.Runtime.Register("removeIf", "(Ljava/util/function/Predicate;)Z", "GetRemoveIf_Ljava_util_function_Predicate_Handler:Java.Util.ICollection, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public virtual bool RemoveIf(Java.Util.Functions.IPredicate filter);
[<Android.Runtime.Register("removeIf", "(Ljava/util/function/Predicate;)Z", "GetRemoveIf_Ljava_util_function_Predicate_Handler:Java.Util.ICollection, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member RemoveIf : Java.Util.Functions.IPredicate -> bool
override this.RemoveIf : Java.Util.Functions.IPredicate -> bool

參數

filter
IPredicate

一個謂詞,回傳 true 以表示要移除的元素

傳回

true 如果有元素被移除

屬性

備註

移除該集合中所有滿足該謂詞的元素。 在迭代過程中或謂詞拋出的錯誤或執行時異常會被轉發給呼叫者。

新增於1.8版本。

的 java.util.Collection.removeIf(java.util.function.Predicate<? super E>)Java 檔。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於