Exemple #1
0
        /// <summary>
        /// Test if any of the matched elements match the supplied query.
        /// </summary>
        /// <param name="query">A selector</param>
        /// <returns>true if at least one element in the list matches the query.</returns>
        public bool Is(string query)
        {
            Elements children = Select(query);

            return(!children.IsEmpty);
        }
Exemple #2
0
        /// <summary>
        /// Remove elements from this list that match the <see cref="Selector"/> query.
        /// E.g. HTML: <code>&lt;div class=logo&gt;One&lt;/div&gt; &lt;div&gt;Two&lt;/div&gt;</code>
        /// <code>Elements divs = doc.Select("div").Not("#logo");</code>
        /// Result: <code>divs: [&lt;div&gt;Two&lt;/div&gt;]</code>
        /// </summary>
        /// <param name="query">query the selector query whose results should be removed from these elements</param>
        /// <returns>a new elements list that contains only the filtered results</returns>
        public Elements Not(string query)
        {
            Elements output = Selector.Select(query, this);

            return(Selector.FilterOut(this, output));
        }