Given the following:
String s = "The The The the the the";
How can I find how many instances of “The” are in the string s?
s.matches("The") only tells me if it at least one is there.
s.contains("The") is the same.
Is there some simple way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Give a try of this: