Blogger

Delete comment from: Java67

int i,count=0;
int LengthOfString=word.length();

for(i=0;i<=LengthOfString;i++)

{
if(word.indexOf("World") != -1)
{

count=count+1;
}

}
System.out.println("Total Repetitions are : "+ count)

Feb 19, 2019, 5:34:00 PM


Posted to How to check String contains a text in Java? contains() and indexOf() Example

Google apps
Main menu