I know how to check if a specific word exists within a string in AS3 by doing the following:
if (inventory.text.indexOf(“item”) >= 0) {
//do something
}
But what I don’t know how to do is checking if a specific word (such as “item” in this case) exists more than once in a string. Like, how do you check if there are two “items” in the string? Any ideas? Thanks.