I have the following for loop which iterates through a list of strings and stores the first character of each word in a StringBuilder. I would like to know how can
StringBuilder
Simple way using method reference :
List list = Arrays.asList("ABC", "CDE"); StringBuilder sb = new StringBuilder(); list.forEach(sb::append); String concatString = sb.toString();