String trim example

String trim method is used to remove the leading and trailing white spaces in a String.

String trim method example

Output

Reference

1. String trim() API