logo CodeStepByStep logo

IsRotation

Language/Type: VB string parameters return boolean

Write a function 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.

Function: Write a VB function as described, not a complete program.

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.