[Java] String[] to List, List dedup. List to String comma

ITWeb/개발일반 2016. 11. 9. 12:42

이젠 뭘 해도 기억력이 따라오질 못합니다. ㅠ.ㅠ

복습을 위해서.


Stirng[] to List)

String[] keywords = {"기어", "s3", "기어"};

List<String> lists = Arrays.asList(keywords);


List DeDup)

HashSet<String> set = new HashSet<>(lists);

List<String> result = new ArrayList<>(set);


List to String comma)

StringUtils.join(result, ',');


: