Guido Krüger's Web Service

C-style printf formatting


Introduction

The gk.util.Str class provides a number of extensions over the standard String class in Java. The most useful methods are those of the getFormatted family which could be used to create formatted output similar to the capabilities of the well-known printf function in C.

Documentation

The documentation is inlined and could be created using the javadoc utility. Here, we give only a short summary:

This class provides a number of supporting String methods which are otherwise not found in the java.util package. They are implemented as static methods which take a String as argument and/or provide a String as return value. This class can be divided into the following sections:

getFormatted mostly follows the conventions used in C/C++ printf formatting, though there are some slight differences. If you're not familar with printf, you may consider to take a look in any good C reference. Here are the rules for out format String:


© 1995-2004 Guido Krüger - Last updated 31 Dec 2003 - Back to top-level page