I learned string.trim()
removes leading and trailing spaces. But in my case its not working i am trying below code but output is with leading and trailing space. But my expectation is text without leading and trailing space. Here is my code.
String s = " Hello Rais ";
s += " Welcome to my World ";
s.trim( );
System.out.println(s);
Please help me