Lua在同一行上打印 [英] Lua print on the same line

查看:244
本文介绍了Lua在同一行上打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Pascal中,我有writewriteln.显然,Lua的print与Pascal的writeln相似.我们是否有类似于Pascal的write的东西?连续的打印命令如何将其输出发送到同一行?

In Pascal, I have write and writeln. Apparently Lua's print is similar to writeln of Pascal. Do we have something similar to write of Pascal? How can consecutive print commands send their output to the same line?

print("Hello")
print("World")

输出:

Hello
world

我想要这个:

Hello world

推荐答案

使用io.write代替print,这旨在用于简单的用途,例如调试.

Use io.write instead print, which is meant for simple uses, like debugging, anyway.

这篇关于Lua在同一行上打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆