132
|
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 }
|