[Question]
  [
The prospect of this challenge is:
* If your program is run normally, all of the code in the speech marks (`"` - double quotes) should be printed.
* If your program is wrapped in double quotes (in turn inverting the speech marks), the code that is normally not in quotes should be printed.
E.g:
Let's say you have the following code:
```
fancyStuff("myCode"); "I like".isGreat();
```
If I run it, I would expect an output of:
```
myCode
I like
```
However, if I wrapped it in quotes, I would get:
```
"fancyStuff("myCode"); "I like".isGreat();"
```
When this code is run, the expected output would be:
```
fancyStuff(
); 
.isGreat();
```
Obviously, the above example is not a functional response in any language. Your job is to write the code that performs in this way.
# Rules
* Standard loopholes apply.
* The printed values, in both quoted and unquoted forms, must be non-empty, or consist solely of whitespace. This also means that all programs must include at least one set of quotes.
* However, trailing/preceeding whitespace is allowed.
* No looking at your own code, required file names, etc.
* Unmatched quotes are disallowed
* If there are multiple strings, they can either be printed as newlines (as in the example), or in some other *human-readable* way - no arrays or objects
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins.
  
[Answer]
# [Python 2](https://docs.python.org/2/), 20 bytes
```
print";print'print'"
```
-7 bytes thanks to tsh
[Try it online!](https://tio.run/##K6gsycjPM/qfnJ@SqmCroKSkFPO/oCgzr0TJGkypQ0il/0AZLqgiEBVtpWsYq6CsUJSam1@WqlBSlJiZk5mXrpCXWg6kU7m4UitSkzVAKjUhTHUldW0QVxvI0PwPAA "Python 2 – Try It Online")
---
# Old answer:
# [Python 2](https://docs.python.org/2/), 27 bytes
```
'';print";print 2*"'';print
```
[Try it online!](https://tio.run/##K6gsycjPM/qfnJ@SqmCroKSkFPNfXd26oCgzr0QJQikYaSnBhP4DFXBB1YKoaCtdw1gFZYWi1Nz8slSFkqLEzJzMvHSFvNRyIJ3KxZVakZqsAVKpCWGqK6lrg7jaQIbmfwA "Python 2 – Try It Online")
### Train of thought behind this answer:
Begin with a simple print, because we need to print *something*.
```
print"a"
```
We also need to print something in the inverted case, ie. have a print inside quotes.
```
print"print"
```
The non-inverted case is pretty good at this point. Let's focus on the inverted case. We now start with the string `print`, which can't be followed immediately by a print statement. Let's fix this with a semicolon.
```
print";print"
```
Good stuff. Except, the inverted code doesn't actually print anything. We'll need to print the `print` at the start, because it ends up in quotes, but also print whatever comes after the second quote, because it ends up in quotes too. The obvious way around this is to append `print` and multiply the last string by 2.
```
print";print 2*"print
```
Now the inverted code works fine, though we have to be wary of the fact that the section before the first quote and the section after the second quote need to be kept the same throughout future changes. As for the non-inverted code, it throws a syntax error - once again, we need to introduce a semicolon to separate expressions.
```
;print";print 2*";print
```
Python doesn't really like the look of that lone semicolon, so we must satisfy the snake's hunger with two of the same no-op expression, inserted before the first semicolon and the last semicolon. Most expressions will work fine in the first case, but in the second case it must follow `print";print 2*"` in the non-inverted code without breaking anything. We can use `''`, which simply gets concatenated with the prior string.
```
'';print";print 2*"'';print
```
[Answer]
# CSS, 66 bytes
```
body:after{content:"{}body:after{content:'body:after{content:}'}"}
```
```
"body:after{content:"{}body:after{content:'body:after{content:}'}"}"
```
Not so much questions may be solved by CSS...
[Answer]
# [HQ9+](https://esolangs.org/wiki/HQ9+)[see notes below], 1016 bytes
```
"Hello World"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""Hello World
```
Use the implementation on <https://esolangs.org/w/index.php?title=HQ9%2B&oldid=59995> and compile the interpreter with MinGW GCC 5.3.0 on Windows. I'm not sure if it works with other version of compiler, since an undefined behavior of C is required to terminate the program. The buffer is 1000 bytes long. And source code greater than 1000 bytes do the trick. I'm not sure how these happened. 
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 4 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
"A"§
```
Outputs concatenated without separator.
[Try it online](https://tio.run/##yy9OTMpM/f9fyVHp0PL//wE) or [try it online with surrounding quotes](https://tio.run/##yy9OTMpM/f9fSclR6dBypf//AQ).
**Explanation:**
```
        # Program without surrounding quotes will output string "A"
"A"     # Push "A" to the stack
   §    # Cast it to a string
        # (output the top of the stack implicitly as result)
        # Program with surrounding quotes will output string "§"
""      # Push an empty string to the stack
  A     # Push the alphabet to the stack: "abcdefghijklmnopqrstuvwxyz"
   "§"  # Push "§" to the stack
        # (output the top of the stack implicitly as result)
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 4 bytes
```
"P"s
```
Try it [unquoted](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=IlAicw) or [quoted](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=IiJQInMi)
`P` is the Japt variable for the empty string and the `s` method slices a string - without any arguments, it does nothing.
---
Or, ever so slightly less trivial:
```
"+"u
```
Try it [unquoted](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=IisidQ) or [quoted](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=IiIrInUi)
The first one uppercases `+` and the second one appends `u` to an empty string.
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~113~~ ~~112~~ ~~107~~ ~~70~~ 64 bytes
```
Write(".f();static void f(this string s){Write(s+')'+';');}//");
```
*Saved 5 bytes thanks to @negative seven*
[Unquoted](https://tio.run/##Sy7WTS7O/P8/vCizJFVDSS9NQ9O6uCSxJDNZoSw/M0UhTaMkI7NYobikKDMvXaFYsxqisFhbXVNdW91aXdO6Vl9fSdP6/38A "C# (Visual C# Interactive Compiler) – Try It Online") and [Quoted](https://tio.run/##Sy7WTS7O/P9fKbwosyRVQ0kvTUPTurgksSQzWaEsPzNFIU2jJCOzWKG4pCgzL12hWLMaorBYW11TXVvdWl3TulZfX0nTWun/fwA "C# (Visual C# Interactive Compiler) – Try It Online")
After a while, I realized that my solution was too complicated. The newest program shown here simply hides the rest of the program in a comment to avoid errors when wrapped in quotes.
When wrapped in quotes, `Write(` is passed onto an extension method, which prints it along with `);`.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 11 bytes
```
say ".say~"
```
[Try it online!](https://tio.run/##K0gtyjH7/784sVJBSQ9I1in9/w8A "Perl 6 – Try It Online")
Prints `.say~` with a trailing newline. Seems too easy. Am I missing something?
When [wrapped in quotes](https://tio.run/##K0gtyjH7/1@pOLFSQUkPSNYpKf3/DwA "Perl 6 – Try It Online"), produces `say` with a space and trailing newline.
[Answer]
# [Foo](https://esolangs.org/wiki/Foo), 4 bytes
```
"P"s
```
[Try it online!](https://tio.run/##S8vP//9fKUCp@P9/AA "Foo – Try It Online") [Also works in Japt.](https://codegolf.stackexchange.com/a/187171/25180)
### 5 bytes (UTF-8)
```
"A"§
```
[Try it online!](https://tio.run/##S8vP//9fyVHp0PL//wE "Foo – Try It Online") [Also works in 05AB1E.](https://codegolf.stackexchange.com/a/187166/25180)
### 9 bytes
```
"!""$;"$;
```
[Try it online!](https://tio.run/##S8vP//9fSVFJScUaiP7/BwA "Foo – Try It Online") [Also works in Runic Enchantments.](https://codegolf.stackexchange.com/a/187165/25180)
### 11 bytes
```
say ".say~"
```
[Try it online!](https://tio.run/##S8vP//@/OLFSQUkPSNYp/f8PAA "Foo – Try It Online") [Also works in Perl 6.](https://codegolf.stackexchange.com/a/187190/25180)
### 20 bytes
```
print";print'print'"
```
[Try it online!](https://tio.run/##S8vP//@/oCgzr0TJGkypQ0il//8B "Foo – Try It Online") [Also works in Python 2.](https://codegolf.stackexchange.com/a/187168/25180)
### 69 bytes
```
body::after{content:"{}body::after{content:'body::after{content:}'}"}
```
[Try it online!](https://tio.run/##S8vP//8/KT@l0soqMa0ktag6OT@vJDWvxEqpuhabsDo2wVr1WqXa//8B "Foo – Try It Online") [Also works in CSS.](https://codegolf.stackexchange.com/a/187194/25180)
Hmm... Foo is a highly adaptable language.
[Answer]
## [><>](https://esolangs.org/wiki/Fish), ~~18~~ 9 bytes
```
"|o<"r>o|
```
*-9 bytes thanks to Jo King*
[Try it online!](https://tio.run/##S8sszvj/X6km30apyC6/5v9/AA)
([quoted](https://tio.run/##S8sszvj/X0mpJt9Gqcguv0bp/38A))
### Explanation
```
"|o<"r>o|
"|o<"     Pushes the quoted characters onto the stack
     r    Reverses the stack
      >o| Outputs all characters on stack & errors
```
```
""|o<"r>o|"
""          No-op
  |         Reverses the IP direction
     "r>o|" Pushes the quoted characters onto the stack (backwards)
  |o<       Outputs all characters on stack & errors
```
[Answer]
# [Befunge-98 (FBBI)](https://github.com/catseye/FBBI), 12 bytes
```
<@,k4"<@,k4"
```
[Unquoted](https://tio.run/##S0pNK81LT9W1tPj/38ZBJ9tECUL@/w8A "Befunge-98 (FBBI) – Try It Online") [Quoted](https://tio.run/##S0pNK81LT9W1tPj/X8nGQSfbBEoq/f8PAA "Befunge-98 (FBBI) – Try It Online")
Both cases print `<@,k4`. Either (or both) of the `@`s can be replaced with `q` instead.
[Answer]
# [Runic Enchantments](https://github.com/Draco18s/RunicEnchantments/tree/Console), 9 bytes
```
"!""$;"$;
```
[Try it online!](https://tio.run/##KyrNy0z@/19JUUlJxRqI/v8HAA "Runic Enchantments – Try It Online") and [`""!""$;"$;"`](https://tio.run/##KyrNy0z@/19JSVFJScUahP7/BwA)
From Kevin Cruijssen, who essentially fixed my first attempt utilizing what I did in my second.
Going down the "fungoids never have unmatched quotes" rule-bending "there's something about this that shouldn't be OK" route, alluded to in my own comment:
## 7 bytes
```
0".""$;
```
[Try it online!](https://tio.run/##KyrNy0z@/99ASU9JScX6/38A "Runic Enchantments – Try It Online") and [`"0".""$;"`](https://tio.run/##KyrNy0z@/1/JQElPSUnFWun/fwA)
Under normal circumstances, this program executes as `0".""$;0".""$;` pushing an integer `0`, then the string `.`, concatenates `$;0`, NOP, concatenates an empty string, prints top-of-stack (the string `.$;0`) and terminates. Wrapping it in quotes produces `"0".""$;"` which pushes a string-`0`, NOPs, concatenates an empty string, prints top-of-stack, and terminates (rendering the previously un-printed integer `0` in string form). The last `"` is left unexecuted (and not part of the *original* program anyway).
Fungoids don't have string literals, they have a command that toggles "read own source as a string" mode and some form of "instruction pointer has reached the source boundary" rule (usually edge-wrap), so the same source-code-positional-byte acts as both "begin string" and "end string" instruction, creating a string literal of that entire row/column (excluding the `"` itself).
[Answer]
## Haskell, 31 bytes
```
putStr"#1;(#)=const<$>putStr--"
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzv6C0JLikSEnZ0FpDWdM2OT@vuMRGxQ4iqqur9D83MTPPNu3/v@S0nMT04v@6yQUFAA "Haskell – Try It Online") Or enclosed in quotes: [Try it online!](https://tio.run/##y0gszk7NyfmfZhvzX6mgtCS4pEhJ2dBaQ1nTNjk/r7jERsUOIqqrq6T0PzcxM8827f@/5LScxPTi/7rJBQUA "Haskell – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), 4 bytes
```
";"q
```
[Try it online!](https://tio.run/##y00syUjPz0n7/1/JWqnw/38A "MathGolf – Try It Online")
The `;` and `q` can be exchanged for a lot of different commands, including no-ops.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 8 bytes
```
p";p'p'"
```
[Try it online!](https://tio.run/##KypNqvz/v0DJukC9QF3p/38A "Ruby – Try It Online")
Wraps output in quotes, which may be illegal.
# [Ruby](https://www.ruby-lang.org/), 17 bytes
```
puts";puts'puts'"
```
[Try it online!](https://tio.run/##KypNqvz/v6C0pFjJGkSqgwml//8B "Ruby – Try It Online")
[Answer]
# [JavaScript (SpiderMonkey)](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/45), 25 bytes
```
print("-print`print()`-")
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNEtLshMSS3Kzc/LTq38/7@gKDOvRENJF0wnQHiaCbpKmv//AwA "JavaScript (SpiderMonkey) – Try It Online")
```
"print("-print`print()`-")"
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNEtLshMSS3Kzc/LTq38/1@poCgzr0RDSRdMJ0B4mgm6SppK//8DAA "JavaScript (SpiderMonkey) – Try It Online")
Trivial but functional.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 4 bytes
```
"P"u
```
Unquoted, it converts the string `P` to uppercase. Quoted, it prints `u`.
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=IlAidQ)
# [Japt](https://github.com/ETHproductions/japt), 4 bytes
```
"P"w
```
Unquoted, it reverses the string `P`. Quoted, it prints `w`.
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=IlAidw)
[Answer]
# R, 16 bytes
```
 ";print(";");" 
```
Note that the above code is not wrapped in the additional quotation marks and has both leading and trailing spaces.
[Try it (non-wrapped version)](https://tio.run/##K/r/X0HJuqAoM69EQ8laSdNaSeH/fwA)
[Answer]
# AppleScript, 9 bytes
```
return"&"
```
### Explained:
```
return"&"    -- returns "&"
```
Quoted:
```
"return"&""  -- implied return of the string "return" concatenated with ""
```
]