Text & Lists
Rotate Text Processor
Transform text with Rotate and the selected rules. Enter the text, set the transformation rules, then copy the result.
This tool runs open-source code from OmniTools (MIT License). See open-source credits.
Rotate Text Processor: List rotation moves items around the ends of a sequence. A right rotation of red,green,blue by one step produces blue,red,green. A left rotation produces green,blue,red. The items keep their relative circular order.
The result contains the same items in a shifted order. Rotation changes the starting position, not the circular order.
- Move the final queue item to the first position.
- Create a shifted version of a repeating sequence.
- Prepare cyclic test cases without shuffling their order.
Instructions
- Enter red,green,blue in Input list.
- Use symbol splitting and commas for both separators. Select Right under Direction and set Rotation step to 1.
- Run the tool. Check for blue,red,green. Select Left to compare the opposite direction.
Example
Input: Mon,Tue,Wed,Thu
Settings: Direction: Right, Rotation step: 1, Split separator: , and Output separator: , (the defaults)
Result: Thu,Mon,Tue,Wed
Choose Left to move Mon to the end instead. That gives Tue,Wed,Thu,Mon.
Limits
- Rotation step must be a positive whole number.
- A step equal to the item count returns the original order. Larger steps wrap around the sequence.
- The tool treats separators as item boundaries. It does not interpret quoted CSV fields.