How could I use
window.localStorage.getItem();
to specify items in localstarage that start with the string \'QQ\'
. In my case the key
I use this:
var keyIndex = 0;
var thisKey = window.localStorage.key(keyIndex);
while(thisKey != '' && thisKey != undefined)
{
if (thisKey.substr(0, 2) == 'QQ')
{
// do whatever you need to do with thisKey
}
keyIndex+= 1;
thisKey = window.localStorage.key(keyIndex);
}
But robertc's solution is right too, it's a bit more simple that way. I actually changed my code to do a for loop too.