title: java String start and end position
body: <p>I have one string and I want to check start and end position.
  For example, my String is "I am new User in  <a href="https://stackoverflow.com/">https://stackoverflow.com/</a>". I would like to show only "User" in this String.
  How can I solve this problem?</p>
  
  <p>I want to show String between new and in. Start position new and end position in. result User 
  I tried this code</p>
  
  <pre><code>String source = "I am new User in  https://stackoverflow.com/";
      int indexOfP = source.indexOf("User");
  
      String result = source.substring(indexOfP, indexOfP + 4);
      System.out.println(result); // prints 'User '
  </code></pre>
  
  <p>but I do not know length of my String.</p>