-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
kind: questionsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Milestone
Description
This is kind of a usage issue and not a bug/feature request. I could be overlooking something trivial as I am very new to the library; if this is the case, please point in the right direcion/documentation.
- What is the issue you have?
When printing/using a value from a string element, the string is quoted:
$ ./test
"value"
- Please describe the steps to reproduce the issue. Can you provide a small but working code example?
#include <iostream>
#include "json.hpp"
using json = nlohmann::json;
int main(int argc, char *argv[])
{
json j = R"({"one": "value"})"_json;
std::cout << j["one"] << '\n';
}
- What is the expected behavior?
Printing/fetching value as opposed to "value".
I understand that this could be a simple matter of picking out a substring, but searching in the documentation and existing issues (closed and open), I didn't find an idiomatic way of simply extracting the original string (no quotes as quotes are not escaped in the JSON blob).
- Which compiler and operating system are you using? Is it a supported compiler?
GCC (7.2.0).
- Did you use a released version of the library or the version from the
developbranch?
Git master, cc937de
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind: questionsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation