Skip to main content
added 614 characters in body
Source Link
Night2
  • 6k
  • 1
  • 14
  • 46

PHP, 65 52(7.4), 31 bytes

-13 bytes by using a function and dropping the need to handle multi-line inputs from Based on STDINPetah's comment.

fn($s)=>preg_replace(__,'!',$s)

Try it online!


PHP, 52 bytes

function($s){return'!'.join('!',str_split($s)).'!';}

Try it online!Try it online!

PHP, 65 52 bytes

-13 bytes by using a function and dropping the need to handle multi-line inputs from STDIN.

function($s){return'!'.join('!',str_split($s)).'!';}

Try it online!

PHP (7.4), 31 bytes

Based on Petah's comment.

fn($s)=>preg_replace(__,'!',$s)

Try it online!


PHP, 52 bytes

function($s){return'!'.join('!',str_split($s)).'!';}

Try it online!

added 87 characters in body
Source Link
Night2
  • 6k
  • 1
  • 14
  • 46

PHP, 6565 52 bytes

-13 bytes by using a function and dropping the need to handle multi-line inputs from STDIN.

while(''<$l=fgetsfunction(STDIN)$s)echo'{return'!'.join('!',str_split($l$s));echo'.'!';}

Try it online!

Not sure if there is a way to get multi-line input shorter than this.Try it online!

PHP, 65 bytes

while(''<$l=fgets(STDIN))echo'!'.join('!',str_split($l));echo'!';

Try it online!

Not sure if there is a way to get multi-line input shorter than this.

PHP, 65 52 bytes

-13 bytes by using a function and dropping the need to handle multi-line inputs from STDIN.

function($s){return'!'.join('!',str_split($s)).'!';}

Try it online!

Source Link
Night2
  • 6k
  • 1
  • 14
  • 46

PHP, 65 bytes

while(''<$l=fgets(STDIN))echo'!'.join('!',str_split($l));echo'!';

Try it online!

Not sure if there is a way to get multi-line input shorter than this.