title: return multiple values java for removing last part of a word
body: <p>In my code, fromright method checks the length of <code>last[]</code> and returns only one string. I want to return all matched values. What's the solution?</p>
  
  <pre><code>public static String last[]={"es","e","s"};
  
  public static void main(String[] args) {
      text tx=new text();
      String checkString = "lives";
      String fin=tx.fromright(checkString);
      System.out.println("remaining:  "+fin);
  }
  
  public String fromright(String wrd) {
      String tmp="";
      for (int i = 0; i &lt; last.length; i++) {
          tmp=wrd.substring(0, wrd.length()-last.length);
      }
      return tmp;
  }
  </code></pre>