Simplify statement by calling substring on str directly. StringUtils.startsWith makes sure that str is not null at this point. Improvement suggested by sebb.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1623872 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
161ef971c4
commit
1e6c8c1495
|
@ -1489,7 +1489,7 @@ public class NumberUtils {
|
|||
return false;
|
||||
}
|
||||
if( StringUtils.startsWith( str, "-" ) ) {
|
||||
return isDigits( StringUtils.replaceOnce( StringUtils.substring( str, 1 ), ".", StringUtils.EMPTY ) );
|
||||
return isDigits( StringUtils.replaceOnce( str.substring(1), ".", StringUtils.EMPTY ) );
|
||||
} else {
|
||||
return isDigits( StringUtils.replaceOnce( str, ".", StringUtils.EMPTY ) );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue