title: Search string in two dimensional string array java
body: <p>I have a two dimensional string array look like this:
  <img src="https://i.stack.imgur.com/WEp43.png" alt="enter image description here" />
  <br>The first column contains characters of many strings, other columns are extra data for character. <br>I want to search a string (maybe change to array character) in this array to get all match indexes (start - end). For example, when I search with key &quot;<strong>next</strong>&quot;, the result should be <strong>[5 - 8], [13 - 16]</strong> (the highlight parts in image above). <br> Shortly, I need a method look like this:</p>
  <pre><code>  public static List&lt;Interval&gt; search(String searchText, String[][] data, int columnsCount, int rowCount){
        // Convert search text to String array
        String[] searchArr = getStringArray(searchText);
        // then search in data
  
    }
    
    // where Interval is:
    public class Interval{
         public int start;
         public int end;
    }   
  </code></pre>
  <p>Is there any fast way to search like this,cause my data is very large?<br>
  Thanks in advance!</p>