//將字串依分割符號轉成 Set<String>
public static Set<String> splitToStringSet(String sourceString,
String splitChar) throws Exception {
Set<String> stringSet = new HashSet<String>();
String[] stringAry = sourceString.split(splitChar);
for (int i = 0; i <
stringAry.length; i++) {
stringSet.add(stringAry[i]);
}
return stringSet;
}
沒有留言:
張貼留言