We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, i would like to ask if i can retrieve a value by a key name ignoring the case?
In source engine KeyValues class, this code:
KeyValues *pKV = new KeyValues("Test"); pKV->SetInt("Apple", 5); Msg("%d %d", pKV->GetInt("apple"), pKV->GetInt("APPLE"));
it prints "5 5", which means the cases are ignored
The text was updated successfully, but these errors were encountered:
Json.NET appears to have a GetValue method that this library doesn't yet support. I'll tag this issue as a feature request.
GetValue
In the meantime, you should be able to filter children manually
// returns 5 pKV.Children<VProperty>().First(x => x.Key.Equals("apple", StringComparison.InvariantCultureIgnoreCase)).Value
You could also write an extension method that does this:
public static class VdfExtensions { public static VToken GetValueIgnoreCase(this VObject obj, string key) { return obj.Children<VProperty>().First(x => x.Key.Equals(key, StringComparison.InvariantCultureIgnoreCase)).Value; } } // returns 5 pKV.GetValueIgnoreCase("apple")
Sorry, something went wrong.
No branches or pull requests
Hello, i would like to ask if i can retrieve a value by a key name ignoring the case?
In source engine KeyValues class, this code:
it prints "5 5", which means the cases are ignored
The text was updated successfully, but these errors were encountered: