【发布时间】:2017-10-28 14:03:53
【问题描述】:
我在 Golang 中有一个用引号括起来的字符串。我的目标是删除两侧的所有引号,但忽略字符串内部的所有引号。我该怎么做呢?我的直觉告诉我要像在 C# 中那样使用 RemoveAt 函数,但我在 Go 中没有看到类似的东西。
例如:
"hello""world"
应转换为:
hello""world
为了进一步澄清,这是:
"""hello"""
会变成这样:
""hello""
因为应该只删除外部的。
【问题讨论】:
标签: go