Monday, 24 April 2017

Get every key starting with a prefix in Node.JS from JSON Data

Hey so I have a JSON string:

{
    "cmd.test1":"test1",
    "cmd.test2":"test2",
    "ab.test1":"nthing"
}

and I want to get all keys (in this case it's cmd.test1 or cmd.test2) starting with a prefix of "cmd.". I am unable to get what I should do. Can someone help me? Thanks!



via AdityaTD

No comments:

Post a Comment