Forgetting quotes can lead to certain problems. For example, in Scala the two expressions:
"("+("+")+(")+(")+")" ("+("+")+(")+(")+") differ only in starting and ending quotes, but they respectively yield the result:
(+)+() +()+()+ But this expression in scala almost has the desired property:
def m="+m+" ""+m+"" Your task is to write the shortest expression surrounded with quotes, such that if we remove the outer quotes, the expression still returns the same string.
Key points:
- Your language must support "..." as string literals
- The program has to contain at least three characters
- You are not allowed to define a context outside of the quotes themselves (as I did for m)
- You are not allowed to use other delimiters for strings, e.g. no
""", no'. - Both expressions should return strings.
- Shortest code wins (counting the quotes themselves)