How to Convert “space” into “ ” with R

后端 未结 4 1802
礼貌的吻别
礼貌的吻别 2021-01-18 16:18

Referring the title, I\'m figuring how to convert space between words to be %20 .

For example,

> y <- \"I Love You\"

How to

4条回答
  •  星月不相逢
    2021-01-18 17:03

    gsub() is one option:

    R> gsub(pattern = " ", replacement = "%20", x = y)
    [1] "I%20Love%20You"
    

提交回复
热议问题