title: How to check if an Array contains a particular word in a String and get it?
body: <p>I have a <code>String[]</code> and an input <code>String</code>:</p>
  
  <pre><code>String[] ArrayEx = new String[1];
  String textInput = "a whole bunch of words"
  </code></pre>
  
  <p>What I want to do is check if the <code>String</code> contains a word present in the <code>Array</code>, like this.</p>
  
  <p>Ex: <code>textInput = "for example"</code> and <code>ArrayEx[0] = "example"</code></p>
  
  <p>I know about this method:</p>
  
  <pre><code>Arrays.asList(yourArray).contains(yourValue)
  </code></pre>
  
  <p>but it checks the full <code>String</code> right? How do I check if the <code>String</code> contains a particular <strong>word</strong> present in the Array. Even if it is from an <code>ArrayList</code> I have no problem.</p>
  
  <p>Also if yes, can I get that word from the <code>String[]</code>? i.e., in the above case get the <code>String</code> "example".</p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>public void searchNearestPlace(String v2txt)
  {
      Log.e("TAG", "Started");
      v2txt = v2txt.toLowerCase();
      String[] places = {"accounting, airport, amusement_park, aquarium, art_gallery, atm, bakery, bank, bar, beauty_salon, bicycle_store, book_store, bowling_alley, bus_station, cafe, campground, car_dealer, car_rental, car_repair, car_wash, casino, cemetery, church, city_hall, clothing_store, convenience_store, courthouse, dentist, department_store, doctor, electrician, electronics_store, embassy, establishment, finance, fire_station, florist, food, funeral_home, furniture_store, gas_station, general_contractor, grocery_or_supermarket, gym, hair_care, hardware_store, health, hindu_temple, home_goods_store, hospital, insurance_agency, jewelry_store, laundry, lawyer, library, liquor_store, local_government_office, locksmith, lodging, meal_delivery, meal_takeaway, mosque, movie_rental, movie_theater, moving_company, museum, night_club, painter, park, parking, pet_store, pharmacy, physiotherapist, place_of_worship, plumber, police, post_office, real_estate_agency, restaurant, roofing_contractor, rv_park, school, shoe_store, shopping_mall, spa, stadium, storage, store, subway_station, synagogue, taxi_stand, train_station, travel_agency, university, veterinary_care, zoo"};
      int index;
      for(int i = 0; i&lt;= places.length - 1; i++)
      {
          Log.e("TAG","for");
          if(v2txt.contains(places[i]))
          {
              Log.e("TAG", "sensed?!");
              index = i;
      }
  }
  </code></pre>
  
  <p>Say <code>v2txt</code> was <code>"awesome airport"</code> the sensed Log never does appear even though all other logs indicate it working</p>
  
  <p><strong>Edit2:</strong></p>
  
  <p>I am so embarrassed that I made such a dunder head mistake. My array is declared wrongly. There should be a <code>"</code> before every <code>,</code>. I am such a big idiot!
  Sorry will change it and let you know.</p>