V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
leisurelylicht
V2EX  ›  Go 编程语言

求问, go 里如何实现 Python 中的 decode("string-escape")

  •  1
     
  •   leisurelylicht · 2019-09-29 18:44:59 +08:00 · 2722 次点击
    这是一个创建于 1664 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请问在 go 里面怎么才能做到类似 python 的 decode("string-escape")decode("unicode-escape")

    2 条回复    2019-09-30 10:54:59 +08:00
    codehz
        1
    codehz  
       2019-09-29 18:53:11 +08:00 via Android
    strconv.Unquote?
    leisurelylicht
        2
    leisurelylicht  
    OP
       2019-09-30 10:54:59 +08:00
    @codehz 应该不是,用 strconv.Unquote 去解码会报错
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2885 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:56 · PVG 15:56 · LAX 00:56 · JFK 03:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.