Justify text

2010-08-09 Thread simendsjo
Phobos assumes that you only want to fill with spaces when justifying text. I merged the functions with a user supplied character. Don't think it should be much slower.. Just the switch extra switch if the function is inlined.. (but don't take my word for it :) )? enum Alignment { Right,

Re: Justify text

2010-08-09 Thread simendsjo
On 09.08.2010 23:59, simendsjo wrote: return justify(s, Alignment.Right, width, ' '); Forgot zfill: string zfill(string s, int width) { return justify(s, Alignment.Right, width, '0'); }