[Question]
  [
**This question already has answers here**:
 
 
[Making Squared Words](/questions/133650/making-squared-words)
 (32 answers)
 
Closed 5 years ago.
Sometimes when you're lying in bed and reading a message, your phone screen will pop into landscape mode right in the middle of a sentence. Only being able to read left to right, you find yourself incapacitated, unable to process the text in front of you.
To ensure that this won't happen again, you decide to make every message readable from any angle, whether your phone screen is rotated or mirrored. To make this happen, each message is printed as a square, with each side of the square containing the message, either in the original order or in reverse. 
* For backwards compatibility, the top side of the square should be the original message.
* To make each message square as compact as possible, the first and last character of the message should be a part of two sides of the square. This means that the top side reads normally, the bottom side is in reverse, the left side reads top-bottom, and the right side reads bottom-top.
## Input
A single string, with 2 or more characters. You should not assume that the string only contains alphanumerical characters or similar.
## Output
The Squarification™ of the string. It is permissible to leave some whitespace at the end of each line, and a single newline at the end of the output. 
## Examples
```
Input: 'ab'
ab
ba
Input: 'abc'
abc
b b
cba
Input: 'Hello, world!'
Hello, world!
e           d
l           l
l           r
o           o
,           w
w           ,
o           o
r           l
l           l
d           e
!dlrow ,olleH
```
This challenge looks like [A cube of text](https://codegolf.stackexchange.com/questions/92410/a-cube-of-text-%DD%80), but I'm hoping that it's different enough that there will be some clever answers.
As this is code-golf, get ready to trim some bytes!
  
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 4 bytes
```
Ｓ‖Ｏ^
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMMzr6C0JLgEyE7X0NS05gpKTctJTS7xL0stykks0LCK07T@/98jNScnX0chPL8oJ0WR679uWQ4A "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
Ｓ       Input the string and implicitly print it
 ‖      Reflect...
  Ｏ     ... overlapping the first and last character...
   ^    ... in the ↙↘ directions (^ is shorthand for ↙↘).
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~12~~ 11 bytes
Saved 1 byte thanks to *Kevin Cruijssen*
```
g4иsûûŽ9¦SΛ
```
[Try it online!](https://tio.run/##ASgA1/9vc2FiaWX//2c00Lhzw7vDu8W9OcKmU86b//9IZWxsbywgd29ybGQh "05AB1E – Try It Online")
**Explanation**
```
g            # length of input
 4и          # quadruplicate in a list
             # these are the string lengths we'll print
   s         # push input
    ûû       # palendromize twice
             # this is the string we'll print
      Ž9¦S   # push [2,4,6,0]
             # these are the directions we'll print
          Λ  # paint on the canvas
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~80~~ ~~76~~ ~~71~~ ~~70~~ 69 bytes
```
lambda s:[s]+map((' '*len(s[2:])).join,zip(s,s[:0:-1]))[1:]+[s[::-1]]
```
[Try it online!](https://tio.run/##TcqxDsIgEIDh3ac4pwOLxna8xN13QAZqS8RcgUAToy@PNC6O358/vddHDEN1l1tlu4yThUK6mG6xSQgEPPAcRNEDGSlPz@iD@vgkiiqaznTsW9U9mU43bzQ1ZR9WcALtiHL3p3ujixkYfNjKdWaOCl4x87RHSb@V6xc "Python 2 – Try It Online")
# [Python 3](https://docs.python.org/3/), 70 bytes
```
lambda s:[s,*map((' '*len(s[2:])).join,zip(s[1:],s[-2:0:-1])),s[::-1]]
```
[Try it online!](https://tio.run/##TYpBDsIgEEX3nmJcwTTU2LqbpHvvgCyobSNmCgSaGL080rhx9997P763R/CXsgy3wnYdJwuZdFbNaqOUAkTDs5dZ92QQT8/gvPq4WEVHRmXd9nSmtqutAu3LlJic3@QihR0F4uEP7zsvIQGD81DVdWYOCl4h8XQUSL8vY/kC "Python 3 – Try It Online")
[Answer]
# [Canvas](https://github.com/dzaima/Canvas), 6 [bytes](https://github.com/dzaima/Canvas/blob/master/files/chartable.md)
```
⤢ｎ：±⇵ｎ
```
[Try it here!](https://dzaima.github.io/Canvas/?u=JXUyOTIyJXVGRjRFJXVGRjFBJUIxJXUyMUY1JXVGRjRF,i=JTIySGVsbG8lMkMlMjBXb3JsZCUyMSUyMg__,v=8)
Explanation:
```
⤢       transpose the input
 n      and overlap that over the input
  :     duplicate that
   ±⇵   reverse it vertically & horizontally
     n  and overlap over the old version
```
[Answer]
# Python 3, ~~78~~ 76 Bytes
-2 bytes thanks to maxb!
```
lambda x:[x]+[x[i]+" "*(len(x)-2)+x[~i]for i in range(1,len(x)-1)]+[x[::-1]]
```
[Try it Online!](https://tio.run/##LcuxCsIwEADQXzlvujOtEN0C7v6BQ5qh0kRP4qWEDnHx1yOI8@Ot7@1R9NTTeep5ft2WGZrzLRjfvASDgHvKUanxeGTT/EdCKhUERKHOeo9kh79b/i3nRhtCX6voBoST4uFZRCkRXmLOZYBrqXnZITP3Lw)
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
```
YTO6Lt&(
```
[Try it online!](https://tio.run/##y00syfn/PzLE38ynRE3j/391j9ScnHwdhfL8opwURXUA "MATL – Try It Online")
### Explanation
Consider input `'abcd'` as an example. Stack is shown bottom to top.
```
YT     % Implicit input: string. Create Toeplitz matrix of chars
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
O      % Push 0
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
                 0
6L     % Push [2, -1+1j]. Used as an index, this means 2:end
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
                 0,
                [2, -1+1j]
t      % Duplicate
       % STACK: ['abcd';
                 'babc';
                 'cbab';
                 'dcba']
                 0,
                [2, -1+1j],
                [2, -1+1j]
&(     % Write 0 into the internal entries of the char matrix.
       % STACK: ['abcd';
                 'b  c';
                 'c  b';
                 'dcba']
       % Implicitly display. Char 0 is shown as a space
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 14 bytes
```
¦¨s¨š.BsRøJIRª
```
[Try it online!](https://tio.run/##ASwA0/9vc2FiaWX//8KmwqhzwqjFoS5Cc1LDuErCuyxSPf//SGVsbG8sIHdvcmxkIQ "05AB1E – Try It Online")
Outputs as a list of lines, but the TIO link uses the old version which printed instead – [Try an alternative online!](https://tio.run/##AS0A0v9vc2FiaWX//8KmwqhzwqjFoS5Cc1LDuEpJUsKqwrv//0hlbGxvLCB3b3JsZCE "05AB1E – Try It Online"). Thought I'd be nice to show how awesome the canvas is by comparing that approach to others that don't use it. See Emigna's answer for a canvas version, then compare it to mine :)
### How?
```
¦¨s¨š.BsRøJ»,R=    Full program. Accepts a string from STDIN. | Example: "abcd"
¦¨                 Tail and pop.                              | STACK: ["bc"]
  s¨               Swap and pop.                              | STACK: ["bc", "abc"]
    š              Prepend a to b as a list.                  | STACK: [["abc", "b", "c"]]
     .B            Squarify.                                  | STACK: [["abc", "b  ", "c  "]]
       sRøJ        Interleave with the reversed input.        | STACK: [["abcd", "b  c", "c  d"]].
           »,      Join by newlines, pop and print.           | STACK: [] (the above is removed after being printed)
             R=    Print the reversed input (taken implicitly due to the empty stack).
```
The only thing which is different in the 14-byter is that the reversed input is appended to the list rather than printed. 
[Answer]
# [Japt](https://github.com/ETHproductions/japt) `-R`, ~~22~~ 15 bytes
```
U+ÕÅ+UÔÅ Õ·hJUw
```
[Try it online!](https://ethproductions.github.io/japt/?v=1.4.6&code=VSvVxStV1MUg1bdoSlV3&input=IkhlbGxvLCB3b3JsZCEiCgotUg== "Japt – Try It Online")
[Answer]
# Pyth, ~~16~~ 15 bytes
```
LXXb0Qt0_Qy.tym
```
Try it online [here](https://pyth.herokuapp.com/?code=LXXb0Qt0_Qy.tym&input=%22abc%22&debug=0), or verify all the test cases at once [here](https://pyth.herokuapp.com/?code=LXXb0Qt0_Qjy.tym&test_suite=1&test_suite_input=%22ab%22%0A%22abc%22%0A%22Hello%2C%20world%21%22&debug=0) (test suite joins output on newlines for easier verification, as per OP request).
```
LXXb0Qt0_Qy.tymdQ   Implicit: Q=eval(input())
                    Trailing d,Q inferred
L                   Define a function, y(b), as:
  Xb                  Replace in b...
    0                 ... at position 0...
     Q                ... the input string
 X                    Replace in the above...
      t0              ... at position -1 (decrement 0)
        _Q            ... the reversed input string
              mdQ   Split the input string into array of characters
                      (The exact contents of the array don't matter, as long as the array
                       has the same length as the input string and the elements are
                       of length < 2)
             y      Apply the function y (defined above) to the array
                      (For Q="abc", yields ["abc", "b", "cba"]
           .t       Transpose, padding with spaces
                      (For Q="abc", yields ["abc", "b b", "c a"]
          y         Apply y to the above
```
*Edit: OP clarified that a list of lines is acceptable as output, so removed `j` to join on newlines - previous version `LXXb0Qt0_Qjy.tym`*
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~55~~ 51 bytes
```
{$_,|.comb[1..*-2].&{(@_ X~' 'x@_)Z~[R,] @_},.flip}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYKvwv1olXqdGLzk/NynaUE9PS9coVk@tWsMhXiGiTl1BvcIhXjOqLjpIJ1bBIb5WRy8tJ7Og9n@ahlJikpKmnZ1ecWKlNReYm4zC90jNycnXUSjPL8pJUYTL/AcA "Perl 6 – Try It Online")
Returns a list of lines.
### Explanation:
```
{                                                 }  # Anonymous code block
 $_,    # The given string as the first line
     .comb[1..*-2]   # The string as a list of chars without the first or last char
                  .&{                      }  # Passed to a function
                     (@_ X~' 'x@_)  # Each character padded with space
                                  Z~[R,] @_   # And zipped with the reverse
    |   # Flattened
                                            ,.flip  # And the reverse of the string
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~93~~ ~~91~~ ~~87~~ ~~80~~ ~~78~~ ~~77~~ ~~76~~ 74 bytes
```
x=>[...x].map(c=>(w+=z=x[--j])[1]?j?c.padEnd(l-1)+z:w:x,w="",l=j=x.length)
```
[Try it online!](https://tio.run/##BcFBCsMgEADAr7SelOhCrimbnAr9g3gQNWllq5KEKvm8nYn2Zw@3f8qpUvahr9gbzhoAmoGvLdzhzOuAFzatVDRCj2aJi4Ni/TN5TmoUwzXVqcmKjEnCiA0opO18i/5wOR2ZAlDe@MrZKxBleat5J39nQvQ/ "JavaScript (Node.js) – Try It Online")
Returns list of lines.
## Explanation
```
x =>                     // Main function
 [...x].map(c =>         // For each character in the input:
  (w += z = x[--j])[1]   //  Check whether this is not the first row (by producing w, the
                         //  reverse of x, character by character, and check if len(w) > 1)
  ?                      //  If so:
   j                     //   Check if this is not the last row
   ? c.padEnd(l - 1) + z //   If so: return the needed row
   : w                   //   If not (i.e. last row): return w, the reverse of x
  : x,                   //  If not (i.e. first row): return x
  w = "",                // Stores the reverse of w
  l = j = x.length       // A variable that stores the length of the string, and a counter
 )                       // Golfing from 78 onwards is tough work.
```
[Answer]
# [Haskell](https://www.haskell.org/), ~~80~~ ~~76~~ ~~72~~ 71 bytes
* Saved ~~four~~ ~~eight~~ nine bytes thanks to [Laikoni](https://codegolf.stackexchange.com/users/56433/laikoni).
```
f s=s:m[c:m(' '<$s)++[d]|(c,d)<-zip s$r s]++[r s];m=init.tail;r=reverse
```
[Try it online!](https://tio.run/##FY6xDsIgFAB/BUmTQqh8QFt2B50ckQGBRiLQhkc1Mf474nKX3HQPDU8XQq0LAgFjlGaMpEf93AFlTFr1JWawdD5@/IagywhUy39NUfjkCy/ahymL7F4ug6tR@ySi3i5k28u15HPihDF8S5jyPQWfHPCFSqzveGgwjac2sA7oveZgD1jVHw "Haskell – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), ~~20 19~~ 15 bytes
```
p╡╞▒x_xh *+m+nx
```
[Try it online!](https://tio.run/##y00syUjPz0n7/7/g0dSFj6bOezRtUkV8RYaClnaudl7F//9KiUnJKalpSgA "MathGolf – Try It Online")
Edited to an improved version of maxb's original 22 byte solution. Zip operator is sadly lacking though the `m`ap operator has a partial implementation.
### Explanation:
```
p                 Print the original string ["abcd"]
 ╡╞               Remove from the start and end of the string  ["bc"]
   ▒              Convert to a list of chars  [["b","c"]]
    x_x           Reverse, dupe and reverse back again [["c","b"],["b","c"]]
       h          Get length of array without popping  [["c","b"],["b","c"],2]
         *        Create a string with that many spaces [["c","b"],["b","c"],"  "]
          +       Map adding it to every character [["c","b"],["b  ","c  "]]
           m+     Zip add each character of the reversed string [["b  c","c  b"]]
             n    Join with newlines and print
              x   Reverse the original string and implicitly output
```
[Answer]
# [Z80Golf](https://github.com/lynn/z80golf), 48 bytes
```
00000000: 1525 13cd 0380 3806 ff4d 2377 18f5 3e0a  .%....8..M#w..>.
00000010: ff7b b928 1113 1aff 4105 2805 3e20 ff18  .{.(....A.(.> ..
00000020: f82b 7eff 18e8 131a b720 0176 ff1b 18f7  .+~...... .v....
```
[Try it online!](https://tio.run/##Nc5NagMxDAXgfU/xoBQKASHZmVjJYqDd9xB2xkoXhSGTn0ILvborN80DIy38PvSlfJg/rDX@zw4yhAES9xM4KsPfBmbrCSGmBFEbECtngJ7Io0Rvj59EIz3cBHHDLBWUbVCISIRkM6yFBwTlXg/sX0Td@Kbnrrz4GEF3I3RDQ0Gq3hStDkXJKMmbLKlfJKUfk9xY/dBfQNc@WnutOL/XpcLmpW84HS95qb8 "Z80Golf – Try It Online")
```
  dec d
  dec h
  inc de
get:
  call $8003
  jr c, got
  rst 38h
  ld c, l
  inc hl
  ld (hl), a
  jr get
got:
  ld a, '\n'
  rst 38h
  ld a, e
  cp c
  jr z, final
  inc de
  ld a, (de)
  rst 38h
  ld b, c
spaces:
  dec b
  jr z, doneb
  ld a, ' '
  rst 38h
  jr spaces
doneb:
  dec hl
  ld a, (hl)
  rst 38h
  jr got
final:
  inc de
reverse:
  ld a, (de)
  or a
  jr nz, cont
  halt
cont:
  rst 38h
  dec de
  jr reverse
```
[Answer]
# Java 11, ~~143~~ ~~142~~ ~~141~~ 140 bytes
```
s->{for(int l=s.length(),i=l;i>0;)System.out.println(i--<l?i<1?new StringBuffer(s).reverse():s.charAt(l+~i)+" ".repeat(l-2)+s.charAt(i):s);}
```
-1 byte thanks to *@OlivierGrégoire*.
[Try it online.](https://tio.run/##bVA9T8MwEN37K45MttpYwEiaVjCx0KUjYnCdS3vFdSL7kgpV4a8HN4lACBZL7935fdxRtzo9Fu@9sToEeNHkLjMAcoy@1AZhc4UAbUUFGLFlT24PQWaR7WbxCayZDGzAQQ59SFeXsvIi/gebB2XR7fkg5IJym9HqNpPbj8B4UlXDqo5abJ2gNF3aNS3v1g7PMFo8NWWJXgSpPLboAwr5EJQ5aP/Iws4/Sc4TSOKwRh2J9F7Ov8cUV2XW9dk1X93sbMw3xRxqnGLJqcnrG2g5NmQMLBK9S4ZuP9j8Jp7R2moB58rb4ib5c4fBYNicTkWubniycMqIEY@K/9xiEuz6Lw)
**Explanation:**
```
s->{                                // Method with String parameter and no return-type
  for(int l=s.length(),             //  Length of the input-String
      i=l;i>0;)                     //  Loop `i` in the range (length,0]
    System.out.println(             //   Print with trailing newline:
     i--<l?                         //    If it's NOT the first iteration:
                                    //    (and decrease `i` by 1 at the same time)
      i<1?                           //    If it's the last iteration:
       new StringBuffer(s).reverse() //     Print the input reversed
      :                              //    Else:
       s.charAt(l+~i)                //     Print the `l-i-1`'th character,
       +" ".repeat(l-2)              //     appended with length-2 amount of spaces,
       +s.charAt(i):                 //     appended with the `i`'th character
     :                               //   Else (it is the first iteration):
      s);}                           //    Print the input as is
```
[Answer]
# Powershell, 93 bytes
```
param($s)$s
if(($m=$s.Length-2)-gt0){1..$m|%{$s[$_]+' '*$m+$s[$m-$_+1]}}
-join($s[($m+2)..0])
```
Test script:
```
$f = {
param($s)$s
if(($m=$s.Length-2)-gt0){1..$m|%{$s[$_]+' '*$m+$s[$m-$_+1]}}
-join($s[($m+2)..0])
}
&$f ab
&$f abc
&$f Hello...
&$f 'Hello, world!'
```
Output:
```
ab
ba
abc
b b
cba
Hello...
e      .
l      .
l      o
o      l
.      l
.      e
...olleH
Hello, world!
e           d
l           l
l           r
o           o
,           w
w           ,
o           o
r           l
l           l
d           e
!dlrow ,olleH
```
[Answer]
# [Red](http://www.red-lang.org), 145 127 bytes
```
func[s][print a: s b: tail s repeat n l:(length? s)- 2[print rejoin[pad first a:
next a l + 1 first b: back b]]print reverse s]
```
[Try it online!](https://tio.run/##VYy7EgIhFEN7viJS6bgWWtLYWtsyFLBcFGXYnQs@/h5XXQurJGeSMPl2JK@NCKqFW@51MXrkmCusQoFTqDamyTGNZCsyklomyqd63qOsNtjNdabLELMerUeIXN57kek5KRLW2M50OnS2v8IZ89vdiQuhmBYgrZPiy6UUn9z/gwOlNHR4DJz8QrYX "Red – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 78 bytes
```
->s{[s.b,*s.chars.zip(s.reverse!.chars).map{|a|"%s%#{s.size-1}s"%a}[1..-2],s]}
```
[Try it online!](https://tio.run/##JchBCoMwEAXQq0RL0BYzYPf2FN2FLEYZMYtCyI@FGnP2tFB4qxf3@VPXqZoHsgXNww20bBxBhw89KMpbIqT555VeHPLJZ6uhLxkEf4gZC1rNxY5E5u4GuFLDnqBW2z03D/XDKglS5@oX "Ruby – Try It Online")
[Answer]
# APL(NARS), 59 chars, 118 bytes
```
{y←⊖⍵⋄0=z←¯2+⍴⍵:⊃,¨⍵ y⋄⊃(⊂⍵),({(∊1(z⍴0)1)\⍵}¨¯1↓1↓⍵,¨y),⊂y}
```
test
```
  f←{y←⊖⍵⋄0=z←¯2+⍴⍵:⊃,¨⍵ y⋄⊃(⊂⍵),({(∊1(z⍴0)1)\⍵}¨¯1↓1↓⍵,¨y),⊂y} 
  f '12'
12
21
  f '123'
123
2 2
321
  f '1234'
1234
2  3
3  2
4321
  f 'Hello World!'
Hello World!
e          d
l          l
l          r
o          o
           W
W           
o          o
r          l
l          l
d          e
!dlroW olleH
  f 'Hello, World!'
Hello, World!
e           d
l           l
l           r
o           o
,           W
             
W           ,
o           o
r           l
l           l
d           e
!dlroW ,olleH
```
[Answer]
# JavaScript, ~~92~~ 85 bytes
Early morning golf on the bus. Not happy with it; there's definitely a shorter way :\
```
s=>s+`
`+(g=r=>--x?s[l-x].padEnd(l)+s[--y]+`
`+g(r+s[y]):r+s[0])(s[l=x=y=s.length-1])
```
[Try it online](https://tio.run/##HcrBCgIhEIDhe2/RTbGRugaznYJ9h0VQVteKQRdnKX162zr9/PC93NvxXJ7rBin70BfsjAMre7BKRCw4ANQbTwTV6NX5e/KCpOIJoJm/iqLs24y8/no2UuwaKzZkTSHF7QEXI/ucE2cKmnIUi7BjIMqnTy7kj1bK/gU)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 28 bytes
*Takes the input as an array of characters*
```
íUz2)£Y©Y<UÊÉ?XqSpUÊ-2:UqÃow
```
---
```
íUz2)£Y©Y<UÊÉ?XqSpUÊ-2:UqÃow    Full program. Implicity input U
                                ["a", "b", "c"]
 Uz2)                           Duplicate and rotate 180°
                                ["a", "b", "c"], ["c", "b", "a"]
í                               Pair each item at the same index
                                [["a","c"],["b","b"], ["c","a"]]
     £                          Map
      Y©Y<                      If index is positive and less than
          UÊÉ?                  Length - 1
              Xq                Join with...
                SpUÊ-2          Space repeated (U length - 2) times
                                [["a","c"],"b b", ["c","a"]]
                      :Uq       Else return joined input
                                ["abc","b b", "abc"]
                         Ãow    Map last item and reverse
                                ["abc","b b", "cba"]
                                Implicity output array joined with new lines
                                "abc
                                 b b
                                 cba"
```
[Try it online!](https://ethproductions.github.io/japt/?v=1.4.6&code=7VV6MimjWalZPFXKyT9YcVNwVcotMjpVccNvdw==&input=WyJIIiwiZSIsImwiLCJsIiwibyIsIiAiLCJXIiwibyIsInIiLCJsIiwiZCIsIiEiXSAtUgoK)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 20 bytes
```
W;ḊW€$O‘z0ṚUoƊo33’ỌY
```
[Try it online!](https://tio.run/##y0rNyan8/z/c@uGOrvBHTWtU/B81zKgyeLhzVmj@sa58Y@NHDTMf7u6J/P//vwdQab6OQnh@UU6KIgA "Jelly – Try It Online")
Assuming that unprintables can also be in the input.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 10 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
▄▀τƒ○≡ë'▲.
```
[Run and debug it](https://staxlang.xyz/#p=dcdfe79f09f089271e2e&i=%22Hello,+world%21%22&a=1)
Unpacked, ungolfed, and commented, it looks like this.
```
{       start a block to repeat
  Mr    rotate matrix counter-clockwise
  0     actually just a literal 0
  x     retrieve "string" from x register, initially the input string
  rX    reverse, and write it back to register
  &     assign reversed "string" to 0 index of matrix (first row)
}4*     exectue block 4 times
m       output matrix as line-separated rows
```
[Run this one](https://staxlang.xyz/#c=%7B+++%09start+a+block+to+repeat%0A++Mr%09rotate+matrix+counter-clockwise%0A++0+%09actually+just+a+literal+0%0A++x+%09retrieve+%22string%22+from+x+register,+initially+the+input+string%0A++rX%09reverse,+and+write+it+back+to+register%0A++%26+%09assign+reversed+%22string%22+to+0+index+of+matrix+%28first+row%29%0A%7D4*+%09exectue+block+4+times%0Am+++%09output+matrix+as+line-separated+rows&i=%22Hello,+world%21%22&a=1)
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 87 bytes
```
s=>[...s].map((e,i,a,n=s.length)=>i<1?s:i>n-2?a.reverse().join``:e.padEnd(n-1)+a[n+~i])
```
Question Title is **Be there, for the Square** but all answers print a **Rectangle**  
  
So here's the one printing square:  
```
s=>[...s].map((e,i,a,n=s.length)=>i<1?a.join` `:i>n-2?a.reverse().join` `:e.padEnd(2*n-2)+a[n+~i])
```
  
  
[Try it online!](https://tio.run/##BcGxDoIwEADQX1GnNpRLcCQWJkcnR0LChR54pF4JB4z@en1vwRN13HjdS0mB8uSz@qYDAO3hi6sx5NihE68QSeb9Y33Dj6rVmhsp7y3CRidtSsbCkliGoSZYMTwlGCkrW2AnxY97m8ckmiJBTLOZzO2N8djJXV6HBL7erM1/ "JavaScript (Node.js) – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~19~~ 18 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 thanks to Erik the Outgolfer (managing to use another repeat, `⁺`, to inline my helper Link)
```
WẋL¬o1¦³ṚUƊ⁺ZƊ⁺o⁶Y
```
A full program.
**[Try it online!](https://tio.run/##y0rNyan8/z/84a5un0Nr8g0PLTu0@eHOWaHHuh417ooCk/mPGrdF/v//X8kDqDZfRyE8vygnRVEJAA "Jelly – Try It Online")**
### How?
```
WẋL¬o1¦³ṚUƊ⁺ZƊ⁺o⁶Y - Main Link: list of characters s
W                  - wrap s in a list
  L                - length of s
 ẋ                 - repeat (yielding a length(s) list of copies of s)
   ¬               - logical NOT (makes every element a zero - giving us a square of zeros)
             Ɗ     - last three links as a monad (say F(x)):
          Ɗ        -   last three links as a monad (say G(x)):
      ¦            -     sparse application...
     1             -       ...to indices: [1]
    o  ³           -       ...do: logical OR with the input (s)
                   -              (replaces the first list with the input)
        Ṛ          -     reverse               }
         U         -     upend (reverse each)  } (turn whole thing 180 degrees)
           ⁺       -   repeat previous link (i.e. G(that result))
            Z      -   transpose
              ⁺    - repeat previous link (i.e. F(that result))
               o⁶  - logical OR with a space character (replace all remaining zeros with spaces)
                 Y - join with newlines
                   - implicitly print
```
---
My 19 byters...
```
;⁶ɓJ»þ`n\«\aƊUṚ»ƊịY
```
[Try this one](https://tio.run/##ATkAxv9qZWxsef//O@KBtsmTSsK7w75gblzCq1xhxopV4bmawrvGiuG7i1n///8iSGVsbG8sIFdvcmxkISI "Jelly – Try It Online"), which works by building a table of indices filled with zeros and then indexing into the input with an extra space (in order to relace the 0s with spaces)
...and the one Erik improved to 18 for me:
```
o1¦³ṚU
WẋL¬ÇÇZƊ⁺o⁶Y
```
[Try this one](https://tio.run/##AToAxf9qZWxsef//bzHCpsKz4bmaVQpX4bqLTMKsw4fDh1rGiuKBum/igbZZ////IkhlbGxvLCBXb3JsZCEi "Jelly – Try It Online").
[Answer]
# [R](https://www.r-project.org/), ~~113~~ 102 bytes
```
function(s,N=nchar(s),m=matrix(" ",N,N)){m[1,]=m[,1]=el(strsplit(s,""))
write(pmax(m,rev(m)),1,N,,"")}
```
[Try it online!](https://tio.run/##NYuxCsIwEED3fkW86Q7OobvZnbo6lA4xJhjIteUStSB@e6yD04P3eNqiOR1bfMy@pmXGwoOd/d0pFmKx4qqmDcEADzwQvWXsebIycj/ZkLFULWtOdf8AiLqXphpwFbehsIYnChH3@/vLnxYRziHnhc1l0Xw7AHW7ctc/PVD7Ag "R – Try It Online")
*Thanks to [JayCe](https://codegolf.stackexchange.com/users/80010/jayce) for saving 6 bytes!*
Writes the string to the first row and column of the array. So long as the string contains only characters with ASCII codepoints greater or equal than 32 (space), which seems allowable by "alphanumeric characters", then the parallel maximum of the matrix and its reverse yields the appropriate matrix, which is then printed out by `write`.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~100~~ ~~103~~ 102 bytes
* Saved a byte thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat); golfing an alternative solution.
```
o,O;v(char*_){for(O=puts(_,o=0)-2;O-++o;)printf("%c%*c\n",_[o],O,_[O-o]);for(o=O;~o;putchar(_[o--]));}
```
[Try it online!](https://tio.run/##ZY3BDoIwEER/RZuQ7EKbiNcNd2/9ACEEV1ESYElFPBD99dpy9TTJZN4bNndm70VbWoAfjUtrXFtxYIvpNT@h1lIc0BzJmiwTwsl149yCSjhJuRyVrs9SaRvCGqmQIiqFpa9Q4KMQwsKYCpE@fmi6EXBdQDUXhbQ9qGBB2ir@68r8dOt70bu3uP66V1keNT8 "C (gcc) – Try It Online")
[Answer]
# [Java (JDK)](http://jdk.java.net/), 109 bytes
```
s->{int l=s.length,i=0;var r=new char[l][l--];for(char c:s)r[i][0]=r[0][i]=r[l-i][l]=r[l][l-i++]=c;return r;}
```
[Try it online!](https://tio.run/##dU@xbsIwEN3zFVeWJiWx6JpgqqpS1aVTx8iDMQmYGjs6OyCE8u2pHSDpgiz5zvfePb@350ee7Te/vTw0Bh3s/Zu0TipSt1o4aTR5KSKhuLXwzaW@RABNu1ZSgHXc@XI0cgMHD8U/DqXelgw4bm0CgQrweZNZih3HkqXXUrIV1EB7m60uUjtQ1BJV6a3bpZIuiiNHQKqrEwx0xUqVZayoDcZhACK3CZaSlQtG0V@@9VVlfqKGLizI@ZxRUWDlWtSARdcXg6PRpquss0BvRgFmfD1Lp15Mj69KKZPCyaDaPM2GaXcVC5aC26CVXxWTUXCI4T@oCW8adY4DTJz58BHeEfk5TpLiRr1H87ZsDjhpTJBPDfY/4KOcrasOxLSOND6UiwUs4RXe4NmfHMQo7/1Gj5aUjkfenfWYExhd1PV/ "Java (JDK) – Try It Online")
Returning a 2D array containing the characters to print. The inner of the array is filled with `\0` instead of spaces because no rules said spaces have to be used.
[Answer]
# PHP, 207 Bytes
```
$k=str_pad('',($L=mb_strlen($s=$argv[1]))-2,' ');$p=[];for($i=1;$i<=$L;$i++){$p[]=($j=mb_substr($s,$L-$i,1));if($i==1)$b=$s;elseif($i==$L)$b=implode('',$p);else$b=mb_substr($s,$i-1,1).$k.$j;echo$b.PHP_EOL;}
```
Not quite a creative entry, but it supports UTF-8 at least...
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 78 bytes
```
(.+).
$1¶$&
O$^r`.\G
+`^(.*)(.)(¶(.*).)
$1¶$2$4$3
^¶
T`p` `(?<=.¶.).*(?=.¶.)
```
[Try it online!](https://tio.run/##K0otycxL/P9fQ09bU49LxfDQNhU1Ln@VuKIEvRh3Li7thDgNPS1NDT1NjUPbQCw9TYgiIxUTFWOuuEPbuLhCEgoSFBI07G1s9Q5t09PU09Kwh7D@//dIzcnJ11EIzy/KSVEEAA "Retina 0.8.2 – Try It Online") Handliy beating my [previous attempt](https://codegolf.stackexchange.com/a/133762/17602). Explanation:
```
(.+).
$1¶$&
```
Duplicate all but one character.
```
O$^r`.\G
```
Reverse the original.
```
+`^(.*)(.)(¶(.*).)
$1¶$2$4$3
```
Move characters from the duplicate to the original one at a time, creating a filled square.
```
^¶
```
Delete the blank line now that the duplicate has been processed.
```
T`p` `(?<=.¶.).*(?=.¶.)
```
Change all inner characters to spaces.
]