title: How can I use hash sets in java to determine if a string contains valid characters?
body: <p>I'm writing a lexical analyzer and have never used hash sets. I want to take a string and make sure it's legal. I think I understand how to build the hash set with valid characters but I'm not sure how to compare the string with teh hash set to ensure it contains valid characters. I can't find an example anywhere. Can someone point me to code that would do this?</p>