title: Java: String.substring() with long type parameters
body: <p>I have a large string (an RSS Article to be more precise) and I want to get the word in a specific startIndex and endIndex. String provides the substring method, but only using ints as its parameters. My start and end indexes are of type long.</p>
  
  <p><strong>What is the best way to get the word from a String using start and end indexes of type long?</strong></p>
  
  <p>My first solution was to start trimming the String and get it down so I can use ints. Didn't like where it was going. Then I looked at <a href="http://commons.apache.org/lang/" rel="noreferrer">Apache Commons Lang</a> but didn't find anything. Any good solutions?</p>
  
  <p>Thank you.</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>Just to provide a little more information.</p>
  
  <p>I am using a tool called <a href="http://gate.ac.uk/" rel="noreferrer">General Architecture for Text Engineering (GATE)</a> which scans a String and returns a list of Annotations. An annotation holds a type of a word (Person, Location, etc) and the start and end indexes of that word . </p>
  
  <p>For the RSS, I use <a href="https://rome.dev.java.net/" rel="noreferrer">ROME</a>, which reads an RSS feed and contains the body of the article in a String.</p>