Is it possible to do something like this:
var s:String = format("%20d %-10s %s", time, type, message);
In languages like C, C++, C#, Python, and Perl there is something similar to my example, but I can't seem to find it for Flex.
I don't want to create special class Formatter for every string that I want to format.
You probably are looking for mx.utils.StringUtil.substitute(). Works similar to .NET String.Format().
For Example:
Adobe Livedocs for StringUtil class
Found this script that implements sprintf - and that's exactly what I was looking for. Thanks to Manish Jethani!
The printf-as3 project sounds like it should fit your needs