Tags

Jan 22, 2012

Java String formatting

Today, I learned how to use the String format method to format my text.

Let's take a look at a few quick examples.


here is an example of how to use multiple variables with the String format method:

log.debug( String.format("%s is %d null", user.getUserName()) );


Note that I keep using the log.debug method in these examples for a reason, specifically that I want to show this String format method.

No comments:

Post a Comment