Introduction
Bob runs a deli. His deli serves sandwiches to its customers. However, it is a bit unusual. At Bob's deli, instead of telling Bob what they want, customers show Bob an ASCII art drawing of their sandwich. Bob must find the pattern in their sandwich so he knows what ingredients to prepare. However, Bob does not like picking out patterns. He wants you to write a program to help him do that.
Challenge
You must write a function which, given the filling of a sandwich, will output a list of ingredients for Bob to prepare. You must find the pattern of ingredients in the filling, then output that pattern.
- Input will be a string. It will never be empty, and it will only contain printable ASCII characters (characters 32 to 255). If your language has no method of input, input can be taken in the form of command line arguments or stored in a variable.
- Output must be a string. If your language has no method of output (or you are running a function, not a full program) you may output through return code or through a variable.
Example I/O
Input: |&|&|&|&
Output: |&
Input: :&|:&|:&|
Output: :&|
Input: ((&|((&|((&|((&|
Output: ((&|
Rules
This is code-golf, so shortest answer wins!
|&|&
a valid answer for the first example input? \$\endgroup\$