logo CodeStepByStep logo

isRotation

Language/Type: Java string parameters return boolean
Related Links:

Write a method named isRotation that accepts two strings as parameters and returns true if they are rotations of each other. Two strings are considered rotations if they contain the same characters in the same relative order when wrapped around. For example, the call of isRotation("abcde", "deabc") should return true. The call of isRotation("abcde", "edcba") should return false because the characters are not in the same order. A string is also considered to be its own rotation.

Method: Write a Java method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.