Here you can find the source of concatUniq(String[] part1, String[] part2)
public static String[] concatUniq(String[] part1, String[] part2)
//package com.java2s; import java.util.ArrayList; public class Main { /**//from ww w . jav a2 s. c o m * Concat two arrays of Strings, and prevent that duplicate * Strings are present in result * part2 is appended to part1 */ public static String[] concatUniq(String[] part1, String[] part2) { ArrayList nlist = new ArrayList(); for (int i = 0; i < part1.length; i++) { if (!nlist.contains(part1[i])) nlist.add(part1[i]); } for (int i = 0; i < part2.length; i++) { if (!nlist.contains(part2[i])) nlist.add(part2[i]); } return (String[]) nlist.toArray(new String[0]); } }