Scala Programming: Check the number of appearances of the two substrings appear any where in the string
Write a Java program to check the number of appearances of the two substrings appear any where in the string.
Sample Solution:
Scala Code:
Sample Output:
The given string is: Thisisthethesis Are the appearance of 'the' and 'is' equal? false The given string is: Thisisthethes Are the appearance of 'the' and 'is' equal? true
Scala Code Editor :
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a Scala program to calculate the sum of the numbers appear in a given string.
What is the difficulty level of this exercise?
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics