All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.opencodes.utils.ArrayUtils Maven / Gradle / Ivy

package cn.opencodes.utils;

import java.util.Arrays;
import java.util.List;

public class ArrayUtils extends org.apache.commons.lang.ArrayUtils{
	
	/**
	 * 字符串转list
	 * @param a 字符串
	 * @param regex 分隔符
	 */
	public static List asList(String a, String regex){
		if (StringUtils.isNotBlank(a)) {
			return Arrays.asList(a.trim().split(regex));
		}
		return null;
	}
	
	/**
	 * 字符串转list --- 默认逗号分隔
	 * @param a
	 */
	public static List asList(String a){
		return asList(a, ",");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy