I'm a bit on the fence about pushing printf() at this point in the learning curve. On the other hand many beginners go through contortions to get output formatted properly (or not at all), that a smattering of printf() might be useful sooner rather than later. Initially look at %s and %n and if they are beyond you don't worry, you can come back to it later.
Campbell Ritchie wrote:That's a pleasure
Don't try printf later; try it now. I think the sooner you use it the better. If you go through the Formatter documentation, you can find about the several hundred combinations of %‑tags . . . . . . . and if you forget 99% of them within 10″, who cares?
That is what I meant about, “if you forget 99% of them”. As long as you know where the information is, you can look it up when you need it.
Carey Brown wrote:. . . if they are beyond you don't worry, you can come back to it later.
. . . as well as Formatter#format(), which also works the same way. I suspect all those other methods create a Formatter object and use its format() method. Now you can write text in all sorts of places with similar methods
Carey Brown wrote:. . . the String class has a format() method that essentially works the same way.
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Javahttps://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire