val time = json.lookup<String?>("query.results.channel.title").toJsonString(true)输出
雅虎天气-美国AK,Nome
有没有一种没有括号和引号的输出方法?
我猜
.replace("[\"","").replace("\"]","")不是最好的方法
发布于 2017-07-14 08:17:07
括号包含在默认实现中(请参阅最底层的函数https://github.com/cbeust/klaxon/blob/master/src/main/kotlin/com/beust/klaxon/DSL.kt appendJsonStringImpl)
因此,通过配置删除它们是不可能的。
如果您为这个特定的类编写扩展函数,它可能会工作,但我想这不是您想要的。
因此,如果不编写自己的扩展程序(-function),目前是不可能做到这一点的。
https://stackoverflow.com/questions/45097752
复制相似问题