我想将一个字符串拆分为一个切片但是想要保留分隔符。 有没有办法在golang中做到这一点?
例如
输入:
"Hello! It's, a? beautiful$ day* (today and tomorrow).
输出:
[Hello | ! | It's | , | a | ? | beautiful | $ | day | * | ( | today | and | tomorrow | ) | . ]
|
有人可以帮忙吗?
我想将一个字符串拆分为一个切片但是想要保留分隔符。 有没有办法在golang中做到这一点?
例如
输入:
"Hello! It's, a? beautiful$ day* (today and tomorrow).
输出:
[Hello | ! | It's | , | a | ? | beautiful | $ | day | * | ( | today | and | tomorrow | ) | . ]
|
有人可以帮忙吗?