Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String 从列表转换<;字符串>;列出<;性格>;JAVA_String_List_Collections_Java 8_Character - Fatal编程技术网

String 从列表转换<;字符串>;列出<;性格>;JAVA

String 从列表转换<;字符串>;列出<;性格>;JAVA,string,list,collections,java-8,character,String,List,Collections,Java 8,Character,好的,一些可能的转换是 List<String> stringList = integerList.stream().map(Object::toString) .collect(Collectors.toList()); List-stringList=integerList.stream().map(对象::toString) .collect(Collectors.toList()); 及 List i

好的,一些可能的转换是

List<String> stringList = integerList.stream().map(Object::toString)
                                    .collect(Collectors.toList());
List-stringList=integerList.stream().map(对象::toString)
.collect(Collectors.toList());

List integerList=stringList.stream()
.map(Integer::valueOf).collect(Collectors.toList());
从字符串列表到字符列表是否有类似上述的转换??

确定:

List<Character> result = 
    stringList.stream()
              .flatMapToInt(String::chars)
              .mapToObj(i -> Character.valueOf((char) i)
              .collect(Collectors.toList());
列表结果=
stream()
.flatMapToInt(字符串::字符)
.mapToObj(i->Character.valueOf((char)i)
.collect(Collectors.toList());
或者干脆

List<Character> result = 
    stringList.stream()
              .flatMapToInt(String::chars)
              .mapToObj(i -> (char) i)
              .collect(Collectors.toList());
列表结果=
stream()
.flatMapToInt(字符串::字符)
.mapToObj(i->(char)i)
.collect(Collectors.toList());
List<Character> result = 
    stringList.stream()
              .flatMapToInt(String::chars)
              .mapToObj(i -> (char) i)
              .collect(Collectors.toList());