Closed uhafner closed 6 years ago
@uhafner is this just to avoid writing using String.format()
? It seem to be a bit of a special cases. Are you running into this a lot, or just for anchors?
There is already a join()
method which you might find useful in some cases.
a(join(getSomething(), "-", getSomethingAgain()))
The reason is to avoid String.format
, yes. I thought it might be useful for others too. Maybe my use case is not typical. I also use join and String concatenation. But most times I prefer to use a String formatter, but this might be a personal preference. (E.g., on the one hand the Java Logger
does support strings and formatted strings as message, on the other hand, Exception
constructors actually not. So there is no real standard in Java anyway.)
Here is an example of my usage.
There hasn't been any interest in this, so I'm going to close the issue and recommend that people use either join()
or String.format()
(you can statically import the method to make it less verbose).
I frequently use formatted strings to create text nodes or to supply properties (like href). It would be nice, if there would be an overloaded method that uses internally a formatter.
Current API:
Expected API
I.e., there need to be additional methods like