Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Java String Trim

We always love working with Strings in our own programs. Strings is one of the most common data structure in most programming language. One common thing we wish to do with String is to clean it up. One common way of cleaning up Strings is by removing spaces from the beginning and the end of the value. For example, when we want to save first name or last name, having spaces at the beginning or the end of a name doesn't make sense. So we want to remove them. This is where the Java String's Trim() method comes in handy. This is what it exactly do. Below are more discussion about how to use Trim method of Java String.



This post first appeared on JavaDevNotes, please read the originial post: here

Share the post

Java String Trim

×

Subscribe to Javadevnotes

Get updates delivered right to your inbox!

Thank you for your subscription

×