Since Java 8 comes with powerful lambda expressions,
I would like to write a function to convert a List/array of Strings to array/List of Integers, Floats, Doubles etc..
In normal Java, it would be as simple as
for(String str : strList){
intList.add(Integer.valueOf(str));
}
But how do I achieve the same with a lambda, given an array of Strings to be converted to an array of Integers.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…