在Common Lisp中居中文本

7

我有一个字符串需要打印,是否可以在打印时居中显示?

1个回答

11

使用~<格式指令。这将返回在70列中居中的"hello there"。

(format nil "~70:@<~A~>" "hello there")

谢谢!您能指引我到其他格式示例的方向吗? - Vhaerun
1
这是有关format的Hyperspec部分:http://www.lispworks.com/documentation/HyperSpec/Body/22_c.htm - Nathan Shively-Sanders
Seibel还提供了一些示例:http://www.gigamonkeys.com/book/a-few-format-recipes.html - Frank Shearar

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接