【发布时间】:2016-06-10 08:18:17
【问题描述】:
我想将字符串保持为以下模式的第一次出现:小写字母后跟大写字母,再后跟小写字母。
例如
"This is My testString, how to keepUntil test"
我想回This is My test
这是我迄今为止尝试过的失败:
library("magrittr")
"This is My testString, how to keepUntil test" %>% gsub("(.*[a-z])[A-Z][a-z]?.*", "\\1", .)
【问题讨论】: