When I parse json, is there any way to distinct this situations:
my_value = "123"
and
my_value = 123
?
When I parse json, is there any way to distinct this situations:
my_value = "123"
and
my_value = 123
?
Copyright © 2021 Jogjafile Inc.
Yes, you can get the type of JSON values. In order to get it, you need to call
QJsonValue::type()
function. In your case it will return eitherQJsonValue::String
orQJsonValue::Double
respectively.