# Make a string a e s t h e t i c [duplicate]

Basically, between every character of a uni-line string, add a space, but there can't be two spaces in between one character.

• aesthetic becomes a e s t h e t i c.

• The quick brown fox jumps over the lazy dog becomes T h e q u i c k b r o w n f o x j u m p s o v e r t h e l a z y d o g.

• I'm Nobody! Who are you? becomes I ' m n o b o d y ! W h o a r e y o u ?

This is code golf, so the shortest answer in bytes wins.

• PS this is my first challenge. Any feedback would be very helpful! – bleh Jan 12 '17 at 2:38
• Would it be acceptable to output one extra trailing space? Will there ever be newlines in the input? – DJMcMayhem Jan 12 '17 at 2:44
• No newlines, yes to extra space – bleh Jan 12 '17 at 2:44
• We can assume input will always be printable ascii? Can input be a char array? – Pavel Jan 12 '17 at 2:47
• Welcome to PPCG. Since you're asking for feedback - 1) This is a very simple challenge that (as you can see from all the quick, short answers) is trivial to answer in many languages. 2) Consider posting challenges to the sandbox first to get more constructive feedback before the challenge officially opens. – Digital Trauma Jan 12 '17 at 3:14

# Jelly, 3 bytes

ḟ⁶K


ḟilter out spaces (⁶) then join by space (K).

Try it online!

• Or ḲFK for the same byte count. – Dennis Jan 12 '17 at 3:09

# Python, 36 bytes

lambda s:" ".join(s.replace(" ",""))

• Ninja'd me by a byte, I used lambda s:" ".join(''.join(s.split())) :P – FlipTack Jan 12 '17 at 22:29

# Retina, 8



.
$0  Whitespace is significant - there are single spaces at the end of the first and last lines. # Pyth, 4 bytes jdsc  Splitting on whitespace and then joining seems shorter than removing the spaces. In pseudocode: ' ' d,Q = " ",input() # preinitialized variables 'jd ' d.join( ' s ' sum( ' cQ' Q.split() ))  Try it online! ## Haskell, 22 bytes (((:" ")=<<)=<<).words  Laikoni saved 2 bytes with a nice use of words. Previous answer: (=<<)(:" ").filter(>' ')  Try it online • (((:" ")=<<)=<<).words is two bytes shorter. – Laikoni Jan 12 '17 at 9:18 # V, 7 bytes Íó*/ X  Try it online! Just a straightforward regex, and an "X" to delete one leading space. # tcl, 28 puts [split [join$s ""] ""]


testable on http://rextester.com/VFP77495