Using ArrayUtils.isEmpty().

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137809 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fredrik Westermarck 2004-02-19 21:31:19 +00:00
parent fc6b3de4e1
commit ccd24d26f8

View File

@ -110,7 +110,7 @@
* @author Phil Steitz
* @author Al Chou
* @since 1.0
* @version $Id: StringUtils.java,v 1.126 2004/02/18 22:59:50 ggregory Exp $
* @version $Id: StringUtils.java,v 1.127 2004/02/19 21:31:19 fredrik Exp $
*/
public class StringUtils {
// Performance testing notes (JDK 1.4, Jul03, scolebourne)
@ -1077,7 +1077,7 @@ public static boolean contains(String str, String searchStr) {
* @since 2.0
*/
public static int indexOfAny(String str, char[] searchChars) {
if (isEmpty(str) || searchChars == null || searchChars.length == 0) {
if (isEmpty(str) || ArrayUtils.isEmpty(searchChars)) {
return -1;
}
for (int i = 0; i < str.length(); i++) {
@ -1145,7 +1145,7 @@ public static int indexOfAny(String str, String searchChars) {
* @since 2.0
*/
public static int indexOfAnyBut(String str, char[] searchChars) {
if (isEmpty(str) || searchChars == null || searchChars.length == 0) {
if (isEmpty(str) || ArrayUtils.isEmpty(searchChars)) {
return -1;
}
outer : for (int i = 0; i < str.length(); i++) {