string - 修改字符串的函数

标签 string r character

我需要一个函数,它将输入作为字符串(空白)并打印出以下内容:

"Hello BLANK World"

即 world("seven") 打印出 "Hello Seven World"

我对如何在 R 中使用字符串感到非常困惑。

最佳答案

您需要函数粘贴

world <- function(x) paste("Hello", x, "World")

关于string - 修改字符串的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20481621/

相关文章:

c# - 如何在 C# 中解码 utf 字符串

python - 如何摆脱逗号分隔字符串中的重复条目

css - 在 Shiny 中,如何为范围 slider 的两个按钮使用不同的颜色?

vim - 如何防止或替换粘贴的 Vim 宏中的奇怪字符

python - 用python生成sql文件(对于mysql)

r - 是否有用于模块化报告生成的\SweaveInput{} 的 R markdown 模拟?

javascript - 在javascript中的某个位置找到单词

python - 如何合并列表中的相似项目

string - Haskell 模式不匹配 [_]

r - 如何关闭plot3D的 "Hit <Return> to see next plot"提示?