Answer:
Scanner scan=new Scanner(System.in);
System.out.println("Input String:");
String str = scan.nextLine();
int count = 0;
str=str.toLowerCase();
for (int i = 0; i < str.length()-1; i++)
{
if (str.substring(i, i + 2).equals("sh"))
{
count++;
}
}
System.out.println("Contains \"sh\" " + count + " times.");
}
}
Step-by-step explanation:
This is what I was able to get for Java.