【发布时间】:2014-07-21 23:15:37
【问题描述】:
我想搜索和替换两个 # 标记之间的单词。
文本是随机的(用户添加)。
例子:
text = "hello this #word1# a it #word2# thanks!"
我需要剪掉# 之间的两个词(word1 和 word2)并将它们更改为标题大小写 - .title()。
期望的输出:
"hello this #Word1# a it #Word2# thanks!"
【问题讨论】:
-
您要在最终文本中保留
#标记,还是删除它们?