【发布时间】:2014-10-14 08:09:05
【问题描述】:
我经常需要向用户展示文本段落。我对向用户呈现文本的知识感到满意(通常使用\n 或文本换行以使其在用户端令人愉悦)但是有没有办法在我的实际代码中使用回车而不需要\n
a = "this is a really long line of text that i need to show to the user. this is a really long line of text that i need to show to the user. this is a really long line of text that i need to show to the user. this is a really long line of text that i need to show to the user."
b = "this is a really long line of text that i need to show to the user.\n
this is a really long line of text that i need to show to the user.\n
this is a really long line of text that i need to show to the user.\n"
所以我的目标是在我的代码中将“a”分解成美观的块,但仍然使用自动换行向用户显示文本。我知道这样做的唯一方法显示在“b”中,但这不适用于自动换行
【问题讨论】: