Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Programming General (http://siteownersforums.com/forumdisplay.php?f=44)
-   -   How do you check if two strings are a rotation of each other ? (http://siteownersforums.com/showthread.php?t=977649)

rajshreedixit01 04-03-2019 11:05 PM

How do you check if two strings are a rotation of each other ?
 
Hello Dear,

Please Tell How do you check if two strings are a rotation of each other ?

travelowebseo 04-23-2019 02:57 AM

Hi,
Check if the length of both Strings is same or not, If not then they are not rotation.
Check if both Strings are equal, if yes then strings2 is a rotation of strings1.
Take the first string's first character and find the index in the second string.


All times are GMT -7. The time now is 09:32 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.