Is it better practice to use String.format over string Concatenation in Java?

Is there a perceptible difference between using String.format and String concatenation in Java? I tend to use String.format but occasionally will slip and use a concatenation. I was wondering if one was better than the other. The way I see it, String.format gives you more power in “formatting” the string; and concatenation means you don’t … Read more

JavaScript equivalent to printf/String.Format

I’m looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() (IFormatProvider for .NET). My basic requirement is a thousand separator format for numbers for now, but something that handles lots of combinations (including dates) would be good. I realize Microsoft’s Ajax library provides a version of String.Format(), but we … Read more