In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
First published in: Aardio by traversing the JSON key-value pair to get the value of the key containing a string _ introduction to computer programming tutorial self-study
Http://jianma123.com/viewthread.aardio?threadid=429
Sometimes the key name in the JSON object changes
But every time there is a pattern of change.
Contains a specific string prefix
So if you want to get its value, but
By traversing key-value pairs
If it is determined that the key name contains a specific string, the value of the key is taken out.
The source code is as follows
Import console
Var str = / / {"value": {"element-6066-11e4-a52e-4f735466cecf": "cb830670-0e36-4593-96c8-e119febcb0a1"}}
Import web.json
Var tab = web.json.parse (str)
Var the value you want to take = ""
For (KJO v in tab.value) {
/ / console.log (kpene v)
If (string.find (k, "element")) {
/ / console.log (v)
The value you want to take is v
}
}
Console.log (the value you want)
Console.pause (true)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.