如何在变量中的文本之间建立一条线 [英] How do I make a line between the text in a variable

查看:57
本文介绍了如何在变量中的文本之间建立一条线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望代码的输出为:

hi

hi

hi

hi





但是它的hihihihihi



我有什么试过:



i want the output of the code to be:
hi
hi
hi
hi
hi

but instead its hihihihihi

What I have tried:

a = "hihihihihi";

system.WriteLine(a, "\n")
# it didn't work

推荐答案

获得此结果

To get this result
hi
hi
hi
hi
hi



你需要输出


you need to output

hi\nhi\nhi\nhi\nhi



in 1 go or 5 times


in 1 go or 5 times

hi\n



但是因为你的代码是


but since your code is

a = "hihihihihi";



您需要按照注释中的说明拆分变量。


you need to split the variable as indicated in comments.


这篇关于如何在变量中的文本之间建立一条线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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