Extract string between /

前端 未结 1 1673

If I have these strings:

mystrings <- c(\"X2/D2/F4\",
               \"X10/D9/F4\",
               \"X3/D22/F4\",
               \"X9/D22/F9\")
相关标签:
1条回答
  • 2021-02-12 17:53

    as.numeric(gsub("^.*D([0-9]+).*$", "\\1", mystrings))

    0 讨论(0)
提交回复
热议问题