【发布时间】:2012-01-30 09:18:13
【问题描述】:
假设我有一个字符串:
cat,mouse,dog,horse
是否有正则表达式或函数可以按如下方式工作?
1)"cat" return string ->"mouse,dog,horse"
2)"mouse" return string ->"cat,dog,horse"
3)"dog" return string ->"cat,mouse,horse"
4)"horse" return string ->"cat,mouse,dog"
我需要从字符串中删除选中的项,并返回字符串的剩余部分。
【问题讨论】: