在Python中,如何通过使用高级格式来使长字符串"Foo Bar"成为"Foo ..."并且不要像"Foo"那样更改短字符串?
"{0:.<-10s}".format("Foo Bar")
只是用点填充字符串
python string
python ×1
string ×1