Best way of matching substring
posted 10 years ago
How should I find "red" in "This is a sentence with the word red in it."? My first inclination is to do a step by step character matching loop. But that seems a bit non-java-ish. I don't see any help in the String api. So do I have to use something like Matcher class?