In this section, you will learn how to remove the blank spaces. For removing the blank spaces use trim() method that removes the blank spaces and shows only string.
Description of code:
This method removes the blank spaces from both ends of the given string (Front and End).
Here is the code of program:
Here is the video tutorial of "How to Trim String in Java?":
Output of program:
String trim example!
Given String : RoseIndia
After trim :RoseIndia
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: June 8, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles