diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index f648d87dae9..11163506038 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -888,8 +888,8 @@ static public void saveFile(String str, File file) throws IOException { // then trim any other character (\r) so saveStrings can print it in the correct // format for every OS String strArray[] = str.split("\n"); - for (String item : strArray) { - item.trim(); + for (int i = 0; i < strArray.length; i++) { + strArray[i] = strArray[i].trim(); } PApplet.saveStrings(temp, strArray);