title: Take out part of a char array and turn it into a string - Java
body: <p>In Java, is there a premade method that I can use to take some selected indices of an array of chars, stick the terms defined by those indices together and return it as a string? The reason I'm looking for a method here is that I would like to avoid having to create another array to hold my selected values. What I'm looking for is something that looks like this:</p>
  
  <pre><code>public String charArrayToString(char[] array, int startingIndex, int lastIndex) {
          // ignore any index that is outside of the startingIndex - lastIndex range
          // turn array[startingIndex], array[startingIndex + 1] ... array[lastIndex] into a string
  }
  </code></pre>