This rule is Obsolete | |
Synopsis: | This call to String.startsWith can be rewritten using String.charAt(0) |
Language: | Java |
Severity Level: | 5 |
Category: | Optimization |
Description: |
Since it passes in a literal of length 1, this call to String.startsWith can be rewritten using String.charAt(0) to save some time.public class Foo { boolean checkIt(String x) { return x.startsWith("a"); } } |