Mercurial > projects > ldc
comparison tango/example/text/formatalign.d @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
1 /** | |
2 | |
3 Example showing how the alignment component in a format string argument works. | |
4 | |
5 Put into public domain by Lars Ivar Igesund | |
6 | |
7 */ | |
8 | |
9 import tango.io.Stdout; | |
10 | |
11 void main(){ | |
12 char[] myFName = "Johnny"; | |
13 Stdout.formatln("First Name = |{0,15}|", myFName); | |
14 Stdout.formatln("Last Name = |{0,15}|", "Foo de Bar"); | |
15 | |
16 Stdout.formatln("First Name = |{0,-15}|", myFName); | |
17 Stdout.formatln("Last Name = |{0,-15}|", "Foo de Bar"); | |
18 | |
19 Stdout.formatln("First name = |{0,5}|", myFName); | |
20 } |