📌  相关文章
📜  提取字符串前的第一个元素 - R 编程语言代码示例

📅  最后修改于: 2022-03-11 14:52:01.557000             🧑  作者: Mango

代码示例1
library(stringr)

df1 <- read.table(text = "ABC|DEF|GHI, ABCD|EFG|HIJK,  ABCDE|FGHI|JKL,  
                         DEF|GHIJ|KLM, GHI|JKLM|NO|PQRS, BCDE|FGHI|JKL")
#extract 1st word before |
word(df1$V1,1,sep = "\\|")