【发布时间】:2016-12-10 22:24:01
【问题描述】:
是否有与 R 的 gsub 函数等效的简单/单行 python?
strings = c("Important text, !Comment that could be removed", "Other String")
gsub("(,[ ]*!.*)$", "", strings)
# [1] "Important text" "Other String"
【问题讨论】:
标签: python r python-2.7