gpt4 book ai didi

clojure - 从字符串表示中恢复映射

转载 作者:行者123 更新时间:2023-12-05 08:59:57 24 4
gpt4 key购买 nike

我有一个表示 clojure 映射的字符串。有没有一种简单的方法可以从字符串中重建 map ?

字符串的例子 -

{:Location {:CountryData {:country_cf 99, :country_code "us", :country "united states"}, :longitude -80.17833, :msa 33100, :dma 528}

最佳答案

使用read-string函数:

(read-string "{:Location {:CountryData {:country_cf 99, :country_code \"us\", :country \"united states\"}, :longitude -80.17833, :msa 33100, :dma 528}}")

关于clojure - 从字符串表示中恢复映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11159287/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com