grep with special characters

前端 未结 3 593
慢半拍i
慢半拍i 2021-01-12 13:47

I want to find the elements that contains star character in the following vector.

s <- c(\"A\",\"B\",\"C*\",\"D\",\"E*\")
grep(\"*\",s)

[1] 1 2 3 4 5
         


        
3条回答
提交回复
热议问题