We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0a7cb19 + 52cea5f commit cc93159Copy full SHA for cc93159
1 file changed
modules/35-methods-using/115-string-immutability/Test.java
@@ -14,7 +14,12 @@ public static void main(String[] args) {
14
15
App.main(null);
16
17
- final var actual = out.toString().trim();
+ String answer = out.toString();
18
+ if (answer != null && answer.endsWith("\n")) {
19
+ // remove linefeed added by println
20
+ answer = answer.substring(0, answer.length() - 1);
21
+ }
22
+ final var actual = answer;
23
24
System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out)));
25
System.out.println(actual);
0 commit comments