本文介绍了如何清除 Ruby 中的终端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何在 Ruby 中做我可以用 C 中的 system("clear")
做的事情.我写了一个像
I would like to know to how to do in Ruby what I can do with system("clear")
in C.I wrote a program like
puts "amit"
system("clear")
我希望在执行此命令后清除控制台,但它不起作用.
I want the console to be cleared after executing this commnad, but it is not working.
推荐答案
如果你想要一些模糊便携的东西,你可以尝试:
If you want something that is vaguely portable you can try:
system "clear" || system "cls"
将尝试 clear
和 cls
这篇关于如何清除 Ruby 中的终端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!