I am trying to search for a string inside a file content which I got into a String.
I've tried to use Pattern() and Matcher() but it didn't work.
Pattern p = Pattern.compile("(</machine>)");
Matcher m = p.matcher(text);
while(m.find())//if the text "(</machine>)" was found, enter
{
Counter++;
}
Aucun commentaire:
Enregistrer un commentaire