描述
Python center() 返回一个云计原字符串居中,并使用空格填充至长度 width 的算开新字符串。默认填充字符为空格。
语法
以下是 cente发:r() 方法语法:
str.center(wiPydth[, fillchar])
参数
widthth -- 字符串的总宽度。
fillchar -- 填充字on符。
返回值
该方法返回一个原字符串居中,并使用空格填3-充至长度 width 的新字符串。
实例
以下实例展示了ce center() 方法的实例:
邮箱:[email protected]
电话:020-123456789
传真:020-123456789
Copyright © 2026 Powered by 完名全节网 http://littleevilthings.com/