title: delete full arraylist element if it has specific sub string in code
body: <p>I have an ArrayList whose output is given as:</p>
  
  <pre><code>[, bd33b056-7a24-490f-a4bb-88cb2687facb%1514759804437%New York, USA%Florida, USA%2018-01-01%2018-01-10%UM-66%3050.0, bd33b056-7a24-490f-a4bb-88cb2687facb%1514759837907%New York, USA%California, USA%2018-01-01%2018-01-10%UM-66%8770.0]
  </code></pre>
  
  <p>Now I am creating a method to have a string id as parameter, when ever is matches with the id of booking it will remove that index.
  The id is after first %, is there any way to find out index of that specific booking?
  Here is method</p>
  
  <pre><code>public static void removeElement(String id) throws FileNotFoundException, IOException{
      BufferedReader b = new BufferedReader(new FileReader("Booking.dat"));
      String d = b.readLine();
      String[] allB = d.split("£");
      ArrayList&lt;String&gt; data = new ArrayList&lt;String&gt;(Arrays.asList(allB));
      data.remove(id);// need to have specific index of id inside the full arraylist
      System.out.println(data);
  }
  </code></pre>