[jdom-interest] [Off topic] Java equivalent to C printf()

Kenworthy, Edward edward.kenworthy at exchange.co.uk
Mon Apr 9 05:02:53 PDT 2001

The short answer is, you're doing it wrong. The longer answer is to use
StringBuffer and a loop.

For functionality far superior to printf have a look at MessageFormat in the
java.text package.

-----Original Message-----
From: James Sinnamon [mailto:sinnamon at usq.edu.au]
Sent: 09 April 2001 22:23
To: jdom-interest at jdom.org
Subject: [jdom-interest] [Off topic] Java equivalent to C printf()

My apologies for this 'off topic' question, but I don't know a suitable list
to post
the question to.
I am hopeful that someone out there might know the answer.

Essentially I am interested to know, how in Java, one accomplishes the same
sort of
string formatting
that is accomplished by the C printf() and sprintf() functions.  I have
trawled through
so many
books on Java and Java reference books, but the information does not seem to
be there.

As I am unable to find this information, my string formatting code is
extremely ugly
and verbose,
and the output still looks ghastly.



James Sinnamon  sinnamon at usq.edu.au

ph 07 46315566,  0412 319669
PO Box 517 Darling Heights QLD 4350

To control your jdom-interest membership:

More information about the jdom-interest mailing list