X37: xyzThere

Write a function in Java that returns true if the given string str contains an occurrence of the substring "xyz" where "xyz" is not directly preceded by a period ("."). For example, "xxyz" counts, while "x.xyz" does not.

Your Answer:

x
 
1
public boolean xyzThere(String str)
2
{
3
    
4
}
5
Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.