You can use replicate
or rep
:
replicate(2, "my_string")
# [1] "my_string" "my_string"
rep("my_string", 2)
# [1] "my_string" "my_string"
paste
will put it together:
paste(replicate(2, "my_string"), collapse = "")
# [1] "my_stringmy_string"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…