Extract string between /

前端 未结 1 1698

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)
提交回复
热议问题