Here you can find the source of stringArrayToHashset(String[] strings)
Parameter | Description |
---|---|
input | strings |
public static HashSet<String> stringArrayToHashset(String[] strings)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/* w ww . j a v a 2 s.co m*/ * A function for converting string arrays to HashSets of strings, provided as a convenience for preparing string arrays for TNRS. * @param input strings * @return a set of Strings containing the input */ public static HashSet<String> stringArrayToHashset(String[] strings) { HashSet<String> stringSet = new HashSet<String>(); for (int i = 0; i < strings.length; i++) { stringSet.add(strings[i]); } return stringSet; } }