Commit ddc9254f by lal Committed by chenzg

提交

parent b3090653
...@@ -23,6 +23,39 @@ public class ClockInTool { ...@@ -23,6 +23,39 @@ public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd"); static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
/**
* 判断某个字符串是否存在于数组中
* @param stringArray 原数组
* @param source 查找的字符串
* @return 是否找到
*/
public static boolean contains(String[] stringArray, String source) {
// 转换为list
List<String> tempList = Arrays.asList(stringArray);
// 利用list的包含方法,进行判断
if(tempList.contains(source))
{
return true;
} else {
return false;
}
}
/**
* @param ss
* @return 去除重复
*/
public static String[] duplicate_removal(String[] ss) {
List<String> list =new ArrayList<String>();
for(String s:ss){
if(!list.contains(s)) //或者list.indexOf(s)!=-1
list.add(s);
}
return list.toArray(new String[list.size()]);
}
/** /**
* 将String时间转换为时间戳 * 将String时间转换为时间戳
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment