[ad_1]
Please stop with those for loops. Don’t invent everything new. Know the API.
List<String> valuesList = Arrays.asList(array).subList(x, y);
String newValuesString = String.join(",", valuesList);
3
[ad_2]
solved for loop iteration – how to avoid comma