JSON.Parse
| JSON = class static (Object) | Interface de JSON | Exemples de JSON |
Qubes 6.1 Effectue l'analyse d'une chaîne JSON
Syntaxe
class function Parse(str: String): JSONVariant (Qubes 7.0)
str: chaîne JSON
Remarques
La chaîne JSON est analysée et le résultat retourné sous la forme d'un JSONVariant qui permet d'accéder aux données de manières similaire à JavaScript.
Pour convertir un JSONVariant ou un autre type en chaîne JSON, voir JSON.Stringify.
Voir aussi ParseUTF8 si str est en utf-8..
Exemples
var j := JSON.Parse('{"hello":["world"]}');
// les lignes suivantes afficheront le même résultat, "world"
PrintLn(j.hello[0]);
PrintLn(j['hello'][0]);
// les lignes suivantes afficheront le même résultat, "world"
PrintLn(j.hello[0]);
PrintLn(j['hello'][0]);