printf 右对齐打印

上一篇 / 下一篇  2008-11-12 10:55:30 / 个人分类:Perl

my @items = qw / wilma dino pebbles /;
printf "The items are: \n".("%10s\n" x @items), @items;

########################################################
C:\Perl\learn>printf.pl
The items are:
     wilma
      dino
   pebbles


TAG: Perl printf 右对齐

 

评分:0

我来说两句

日历

« 2024-04-17  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 47379
  • 日志数: 80
  • 建立时间: 2008-10-27
  • 更新时间: 2009-07-17

RSS订阅

Open Toolbar