0
String s=" hello "; s+=" word "; s.trim(); System.out.println(s);
why trim() not work here
3 Respostas
+ 3
trim() returns a String. It is not a void method since Strings are immutable.
So, you need to assign s to the value of trim().
Like this:
s = s.trim();
0
put them in String builder or buffer and then trim
0
what word u gonna trim here
u didn't mention