Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3941410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:32:22+00:00 2026-05-20T00:32:22+00:00

I have an array of search terms, and a setence. I need to test

  • 0

I have an array of search terms, and a setence. I need to test that the sentence contains all the search terms:

var searchTerms = "fox jumped".Split(' ');
var sentence = "the quick brown fox jumped over the lazy dog".Split(' ');
var test = sentence.Contains(searchTerms);

I exptected test to be True — howerver I get a compile error:
‘string[]’ does not contain a definition for ‘Contains’ and the best extension method overload ‘System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource)’ has some invalid arguments

How should I test that sentence contains all the search terms?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T00:32:22+00:00Added an answer on May 20, 2026 at 12:32 am

    You’re trying to check whether there are any search terms that don’t appear in the sentence:

    if (!searchTerms.Except(sentence, StringComparer.CurrentCultureIgnoreCase).Any())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array returned by the function Search.all : => [#<Search id: 7,
1-)For sorted array I have used Binary Search. We know that the worst case
I have a modified version of binary search that takes in an array in
I have a search form that would like the users to search multiple terms.
I Have a search bar that searches an array, and updates a UITableView with
I need to search an array of objects with an object of search terms
I have UIPicker that I need to write search mechanism for. The data that
I have an array, which I'd like to search for a value in and
Basically, I have an array of strings to search for. If it were only
I have a problem that I need some help on but I feel I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.