As the title, is there any clean Java syntax that supports converting a float array to a string concatenated by comma?
I tried searching for Java stream, but it does not support float array well.
// input:
float[] input = new float[]{1.0f, 0.95f, 0.11f};
// expected output:
"1.0,0.95,0.11"
Update:
Of course, there are many approaches, I can even use a simple loop to do it. But compared to String.join()
for String or Java Stream for double[]
, I would like to know if there's one for float[]
.