I am trying to check for each instance of all array-items in a string. Example;
var string = "aa bb ccc";
var array = ["a", "b", "c"];
This should execute my code 7 times - once for each instance of any array-item being in the string. This is quite hard to explain, but I hope the example is enough.
Another explained-code example;
$.each(ArrayItem in string) {
//execute code
}
I cannot get my head around this one, and haven't yet found anything that remotely works the way I want it to.
Edit
I want to use this to add a price for each letter - say "a,b,c,d,e,f,g" costs $1, while the rest costs $2 - I would need to check for each instance of the array-items above in my string, and calculate the price.
stringis your input and you needarray?