Prathyu Krishna wrote:Code is from Sybex book. I didn't try to run it
First of all, if you use a code snippet, a quote, a code example from another resource, you mustQuoteYourSources (in your original post).
Secondly, you should pay very close attention to the actual code snippet in the book when you are trying to reproduce the output. The actual code snippet isAnd although this code snippet has only 1 character more than your code snippet, it makes a very big difference!
Prathyu Krishna wrote:I understand the trim() now, but what's the output ?
Both are Hello World, Is true the correct answer?
The best way to learn is by doing. You said you didn't run the code yet. Why didn't you? It'll help you understand the code, and you could even try different combinations to discover peculiarities and learn more. Your question would be answered in a matter of seconds.