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

com.github.panhongan.util.collection.ArrayUtil Maven / Gradle / Ivy

There is a newer version: 0.1.8
Show newest version
package com.github.panhongan.util.collection;

public class ArrayUtil {
	
	public static String [] expand(String [] arr, int expand_len, String placeholder) {
		if (arr.length >= expand_len) {
			return arr;
		}
		
		String [] ret = new String[expand_len];
		for (int i = 0; i < arr.length; ++i) {
			ret[i] = arr[i];
		}
		
		for (int i = arr.length; i < expand_len; ++i) {
			ret[i] = placeholder;
		}
		
		return ret;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy