arraysupport.java
来自「大家好啊 快来抢购J2ME东东 挺不错的啊 不要后悔啊 抓住机会」· Java 代码 · 共 38 行
JAVA
38 行
package com.ora.jsp.util;
import java.text.*;
import java.util.*;
/**
* This class contains static methods for working with
* arrays.
*
* @author Hans Bergsten, Gefion software <hans@gefionsoftware.com>
* @version 1.0
*/
public class ArraySupport {
/**
* Returns true if the specified value matches one of the elements
* in the specified array.
*
* @param array the array to test.
* @param value the value to look for.
* @return true if valid, false otherwise
*/
public static boolean contains(String[] array, String value) {
boolean isIncluded = false;
if (array == null || value == null) {
return false;
}
for (int i = 0; i < array.length; i++) {
if (value.equals(array[i])) {
isIncluded = true;
break;
}
}
return isIncluded;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?