Answer the question
In order to leave comments, you need to log in
How to convert int array to string with spaces?
You need to convert an int array to a string with a space delimiter. How to do it?
Answer the question
In order to leave comments, you need to log in
var intArray = new int[]{1, 2, 3};
var string = Arrays.stream(intArray) // преобразуем массив в IntStream
.boxed() // преоборазуем IntStream в Stream<Integer>
.map(String::valueOf) // Integer -> String
.collect(Collectors.joining(" ")); // собираем в строку с разделителем " "
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question