g | x | w | all
Bytes Lang Time Link
014Charcoal251015T113912ZNeil
029JavaScript ES6251015T095116ZArnauld
020APL+WIN251015T092002ZGraham
010Retina 0.8.2251015T073333ZNeil
00505AB1E251015T071758ZKevin Cr
029Google Sheets251015T071551Zdoubleun
015Uiua251015T052242ZRubenVer

Charcoal, 14 bytes

⪫✂θ⁰Lθ⊖LθI⁻Lθ²

Try it online! Link is to verbose version of code. Explanation:

  θ             Input string
 ✂ ⁰            Sliced from start
    Lθ          To end
      ⊖Lθ       Skipping middle
⪫               Joined with
            θ   Input string
           L    Length
          ⁻     Subtract
             ²  Literal integer `2`
         I      Cast to string (not needed on ATO)
                Implicitly print

JavaScript (ES6), 29 bytes

s=>s[0]+~-(n=s.length-1)+s[n]

Try it online!

APL+WIN 20 bytes

Prompts for string

(↑s),(⍕¯2+⍴s),¯1↑s←⎕

Try it online! Thanks to Dyalog APL Classic

Retina 0.8.2, 10 bytes

\B.+\B
$.&

Try it online! Link includes test cases. Explanation: The \Bs prevent the match from happening at the beginning or end of the word, so that the first and last letters are preserved, while the interior is replaced with its length, obtained with the . modifier.

05AB1E, 5 bytes

¦¨Dg:

Try it online or verify test cases taken from Wikipedia.

Explanation:

¦      # Remove the first letter from the (implicit) input-string
 ¨     # As well as its last letter
  D    # Duplicate this middle substring
   g   # Pop and push the length of this copy
    :  # Replace the substring with this length in the (implicit) input-string
       # (after which the result is output implicitly)

Google Sheets, 29 bytes

=left(A1)&len(A1)-2&right(A1)

screenshot

Uiua, 15 bytes

$"___"⊙⧻°⊂⍜⇌°˜⊂

Split off first and last character, take the length of the middle, join in a string