Skip to content

Commit 32f8422

Browse files
authored
Fix trimming
The trim() method returns a new trimmed string, it does not alter the current string (strings being immutable in Java).
1 parent c33fb9f commit 32f8422

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: arduino-core/src/processing/app/BaseNoGui.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,8 @@ static public void saveFile(String str, File file) throws IOException {
888888
// then trim any other character (\r) so saveStrings can print it in the correct
889889
// format for every OS
890890
String strArray[] = str.split("\n");
891-
for (String item : strArray) {
892-
item.trim();
891+
for (int i = 0; i < strArray.length; i++) {
892+
strArray[i] = strArray[i].trim();
893893
}
894894
PApplet.saveStrings(temp, strArray);
895895

0 commit comments

Comments
 (0)