java8 String数组转Long型List

public List<Long> test(String numberStr) {
    String[] strs = orderNumberStr.split(",");
    List<Long> numbers = Arrays.stream(strs).map(str -> Long.parseLong(str.trim())).collect(Collectors.toList());
    return numbers ;
}

你可能感兴趣的:(学习,java,list,开发语言,stream)