title: Best way to handle Sonar rule "Use Index Of Char"
body: <p>I get a Sonar major violation on the following method:</p>
  
  <pre><code>private String getRequestId() {
      final String uuid = UUID.randomUUID().toString();
      return uuid.substring(uuid.lastIndexOf("-") + 1, uuid.length());
  }
  </code></pre>
  
  <p>Sonar advices me to use <code>String.indexOf(char)</code> when checking for the index of a single character since it executes faster than <code>String.indexOf(String)</code>. </p>
  
  <p>I get that. </p>
  
  <p>What I don't get is how to apply this advice on my code in an efficient way. </p>