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:
Benedikt Ritter 2014-09-09 19:32:31 +00:00
parent 161ef971c4
commit 1e6c8c1495
1 changed files with 1 additions and 1 deletions

View File

@ -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 ) );
}