控制台输出中出现不需要的缩进

问题描述 投票:0回答:1

在 rstudio 中运行此代码时:

cat(strrep("-", 5), "\n", strrep("-", 5))

第二行中的虚线缩进。如何删除缩进?

我想要这个:

-----

-----

我明白了:

-----

 -----

r console rstudio
1个回答
0
投票

“缩进”来自分隔

cat()
条目的空格,所以只需执行 ``` 猫(strrep(“-”,5),“ ", strrep("-", 5),sep="")

© www.soinside.com 2019 - 2024. All rights reserved.