View Single Post
Posts: n/a
Default 03-26-2010, 12:33 AM

Originally Posted by dragnet View Post
Not sure I follow exactly what it is you are trying to accomplish, but the trim function is a built in function of the String class. You call it by using string_name.trim(). So from your example above it would be something like monthAbbrev.trim(). That will trim leading and trailing white spaces from the string.

Is that what you wanted to know?
That is exactly what I wanted to know, thank you. I inserted .trim() after monthAbbrev in this line :

System.out.println("\nMonth #" + monthNumber + " is '" + monthAbbrev + "'.");

and that's all it took. As long as I've been messing with this it seems like it should have been more difficult, but I'm not complaining

Thanks again.
Reply With Quote