【发布时间】:2021-02-08 09:57:51
【问题描述】:
我有像“ 例如: “
我试过了: 但它也会将诸如“错误(
我搜索了以下示例:
String replace specific part of string
Replace $x<y$ by $x < y$ 但不幸的是,他们没有提供帮助。data2[1:nrow(data2),] <- as.data.frame(apply(data2[1:nrow(data2),], 2, function(x) sub("<a*", "", x)))
【问题讨论】:
-
看看 [stackoverflow.com/questions/23983450/….特殊字符需要专门处理(有时转义多次)。
-
这样吗?
sub("^<a*", "", x)