Last active
March 17, 2016 20:25
-
-
Save ricardojob/b3051273e7a36c3c6c7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
/** | |
* @author Ricardo Job | |
* @mail ricardo.job@ifpb.edu.br | |
* @since 17/03/2016, 16:31:29 | |
*/ | |
public class RemoveWhitespace { | |
public static void main(String[] args) { | |
Map<String, String> map = new HashMap<>(); | |
map.put("para", "Kelson Duarte"); | |
map.put("assunto", "Trabalhao de Conclusão de Curso"); | |
List<String> collect = map.values().stream() | |
.map(linha -> linha.split("\\s+")) | |
.flatMap(Arrays::stream) | |
.collect(Collectors.toList()); | |
collect.forEach(System.out::println); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment