Delete JoinerSplitter.java (#1161)

This commit is contained in:
Abhinab Kanrar 2017-02-12 13:41:25 +05:30 committed by maibin
parent 4b728ec65b
commit 25dc6bc81c
1 changed files with 0 additions and 40 deletions

View File

@ -1,40 +0,0 @@
package com.baeldung.streamApi;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class JoinerSplitter {
public static String join(String[] arrayOfString) {
return Arrays
.asList(arrayOfString)
.stream()
.map(x -> x)
.collect(Collectors.joining(","));
}
public static String joinWithPrefixPostFix(String[] arrayOfString) {
return Arrays
.asList(arrayOfString)
.stream()
.map(x -> x)
.collect(Collectors.joining(",", "[", "]"));
}
public static List<String> split(String str) {
return Stream
.of(str.split(","))
.map(elem -> new String(elem))
.collect(Collectors.toList());
}
public static List<Character> splitToListOfChar(String str) {
return str
.chars()
.mapToObj(item -> (char) item)
.collect(Collectors.toList());
}
}