Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get all keys matching a char string
Message
 
 
To
30/11/2015 16:40:46
General information
Forum:
HTML5
Category:
Local storage
Miscellaneous
Thread ID:
01628117
Message ID:
01628121
Views:
34
>>Hi,
>>
>>Say I have the following strings (serialized JSON) (Key and Value in the local storage (simplified):
>>
>>
>>"PM_ABCD","long string is here"
>>"PM_1233", "another long string here"
>>"ABC", "Another long string"
>>"PM_G134555","long string"
>>
>>
>>Can I get all keys - into an object - (without getting the Value) that start with a string "PM_"?
>>
>>TIA
>
>I haven't used local storage before, but I'm guessing you probably need to iterate through the keys to find it. See http://tutorials.jenkov.com/html5/local-storage.html#iterating-keys-in-the-local-storage.

Thank you. I think you are right that iterating through the keys would be the approach. I am still not sure if I will use the local storage for "this part" of my project. I am just going through various conceptual designs. Local storage has a limit and I may need to store much more.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform