g | x | w | all
Bytes Lang Time Link
030Red250317T095007ZGalen Iv
099Bespoke250317T054627ZJosiah W
037Tcl170112T031937Zsergiol
250jBasher2250121T182542Zmadeforl
009Dyalog APL160322T205849ZVen
005K ngn/k240315T191042Zcoltim
048C160323T012134Zxsot
038Swift 5.9240315T122646ZmacOSist
090Pascal230831T200009ZKai Burg
017ARBLE230903T224039ZATaco
039Commodore C64 BASIC230601T193714ZShaun Be
357Nibbles230601T172638ZDLosc
043Rockstar230601T154030ZShaggy
030Python230529T132419ZThe Empt
002Thunno 2 J230528T185842ZThe Thon
007Pushy170112T200321ZFlipTack
004Japt170303T192203ZOliver
108CLCINTERCAL210925T003526Zuser1004
019Javascript170604T223935ZVictor
029Factor + sequences.interleaved210923T194903Zchunes
006Silicon160701T100843Zm654
002Vyxal Ṫ210426T152906ZAaroneou
013Grok210408T204404ZAaroneou
016Zsh210214T160134Zpxeger
010BRASCA210212T103137ZSjoerdPe
040naz200102T072524Zsporebal
00305AB1E210202T184313ZMakonede
008PowerShell200102T013754ZGMills
044C# Visual C# Interactive Compiler200102T082424ZJirka Pi
003Keg191228T213136Zlyxal
004W191228T145648Zuser8505
006Befunge98 PyFunge190909T151109Zdavid
021Zsh190909T104507ZGammaFun
010K ngn/k190819T162047Zscrawl
105C#190819T191408Zcanttalk
002Jelly160322T175356ZAdnan
043Elixir160322T211410ZVen
026APLNARS190213T092111Zuser5898
002Japt P190212T171209ZShaggy
024PowerShell190212T135624Zmazzy
007Gol><>190212T001452ZKrystosT
014Perl 6190212T005354ZJo King
044C# Visual C# Interactive Compiler190211T233542Zdana
008Ahead190211T062620Zsnail_
023Brainfuck180127T091919ZDust
009SMBF160322T200739Zmbomb007
036R160322T203931Zlambrusc
010k180309T125059Zulucs
003Canvas180303T191910Zhakr14
002Stax180303T172853ZKhuldrae
039SmileBASIC180303T170151Z12Me21
007MATL160416T180206ZSuever
040Common Lisp160323T221310ZSoupy
nanPython 3180126T161731ZMercury
034Standard ML Mlton180126T150446ZLaikoni
019Excel VBA170703T184830ZTaylor R
045Swift171218T190808ZEndenite
071SNOBOL4 CSNOBOL4171218T184349ZGiuseppe
049Rust171218T183205ZHåv
018Python 3.5160322T182856Zvaultah
028Python 3160322T224348ZRaffi
062Python 2.7160323T125247ZMrPublic
046C160322T194947ZSBI
039Python 3160322T192843ZYytsi
nanJava160322T175510ZCAD97
050C160418T022131Zhomersim
137C#160701T083115ZArnab Bh
035C#160706T185608Zaloisdg
049C170112T043525ZAbel Tom
024Python 2160701T083348ZErik the
052C#170331T190402Zadrianmp
077C++ gcc171214T154759ZTheOutZ
031Julia171217T172443ZLukeS
008MY170726T155938ZAdalynn
004APL Dyalog170726T145053ZAdá
363Taxi170726T161535ZEngineer
037AHK170726T160902ZEngineer
046BrainFlak170703T183521ZDJMcMayh
010Vim170604T161139ZBlackCap
012q/kdb+170604T175300Zmkst
013Carrot170303T200635Zuser4180
044SmileBASIC 3170304T052134Zsnail_
057Lua170303T201704ZJosh
016Threead170112T060351ZATaco
009Cubix170112T221103ZFlipTack
049OIL170112T104829ZL3viatha
031PHP170112T063608ZTitus
044TI84 BASIC170112T063022ZJakob
010Cubix160323T195506ZMickyT
087Batch160322T221037ZNeil
046Swift 2.2160706T190541ZJAL
031Lua160323T082450ZKatenkyo
022brainfuck160322T195231Zmbomb007
044Tcl160704T074733ZByeonggo
005Pyke160322T181625ZBlue
005APL160701T104305ZMoris Zu
0260815160701T104237ZErik the
005Pyth160701T084117ZArfie
041Hoon160418T030248ZRenderSe
011Ouroboros160417T220647ZDLosc
005Pip160417T210810ZDLosc
025MATLAB160416T182031ZSuever
018Octave160416T181327ZSuever
007MATL160322T175324ZLuis Men
020beeswax160329T132136ZM L
005Gema160322T180421Zmanatwor
010Hexagony160322T184234ZAdnan
018Befunge93160323T105636ZJevado
051Matlab/Octave160324T035626ZBen Perl
008Sed160324T021140ZBen Perl
005Japt160323T031515ZMama Fun
011Labyrinth160323T091627ZSp3000
011Prelude160323T184811ZMartin E
010Labyrinth160323T175944ZMartin E
038WhoScript160323T023347ZMCS-Kaij
032PowerShell160323T165723ZMatt
008J160323T165205ZConor O&
012Befunge93160323T162816ZSp3000
057𝔼𝕊𝕄𝕚𝕟160323T030553ZMama Fun
021Befunge98160323T151737ZLuke Mar
004Pyth160322T174623ZMaltysen
039PHP160323T111847Zʰᵈˑ
035Javascript160323T094117ZQwertiy
nanPerl 5160322T210407ZVen
006O 1.2160323T083647Zmanatwor
003Convex160322T182605ZGamrCorp
034Clojure160323T031013ZMattPutn
010RETURN160323T025319ZMama Fun
007Jolf160323T025347ZConor O&
005Retina160322T175022ZDigital
015Reng v.1.2160323T024514ZConor O&
010><>160323T014824ZLuis Men
041Nim160323T014044ZSp3000
020JavaScript160322T182254ZGeneric
015Ruby160322T222504ZDoorknob
042Mathematica160322T210245ZLegionMa
041Ruby160322T200235Zjose_cas
021Grond160322T234135ZBald Ban
035Scala160322T204615Zlambrusc
017LiveScript160322T205115ZVen
120Go160322T201724ZEMBLEM
007Awk160322T190810Zmanatwor
010Vitsy160322T201849ZAddison
092Java160322T200251Zshooqie
006GolfScript160322T185914ZDennis
008sed160322T184313ZNeil
004CJam160322T183244ZLuis Men
00405AB1E160322T180142Za spaghe
009Minkolang 0.15160322T180553ZEl'e
011Haskell160322T180247Znimi
007Seriously160322T180107Zuser4594

Red, 30 bytes

func[s][forall s[prin[s/1""]]]

Try it online!

Bespoke, 99 bytes

spacing expands width of my text
it gets enhanced,and it prints better
we see it,and we prefer it

It's too bad spaces delimit words in Bespoke (and take up extra bytes); it would've been really fun to write this in full-width style.

Tcl, 37 bytes

puts [join [split [gets stdin] ""]]\ 

Try it online!


# [Tcl], 41 bytes
puts [regsub -all (.) [gets stdin] \\1\ ]

Try it online!

jBasher2, 250 bytes

create a with type string
create b with type number
create c with type number
set 0 to c
ask for input
set that to a
get length of a
set that to b
while c < b
get item from a at c
output inline that
output inline " "
add 1 by c
set that to c
endwhile

pretty self explanatory lols

Dyalog APL, 11 9 bytes

,/,∘' '¨

Train that each-adds a space, then joins

K (ngn/k), 5 bytes

,/2$'

Try it online!

Runs as a function within the repl.

If input must be read from STDIN, the following suffices for 9 bytes:

,/2$'*0:`

It is the same as above, but takes a line of input from STDIN via *0:`.

C, 48 bytes

main(c){for(c=8192;read(0,&c,1);write(1,&c,2));}

Try it online

Swift 5.9, 38 bytes

let f={($0+"").map{" \($0)"}.joined()}

Pascal, 90 bytes

This is a full program suitable for a processor supporting “Standard Pascal” and/or “Extended Pascal” as defined by ISO standards 7185 and 10206 respectively. As per specification it takes a line (not many lines). Note, calling EOLn(input) causes an error if EOF(input) is true prior invocation of EOLn. Hence it must be guaranteed that input contains at least an end‑of‑line marker.

program p(input,output);begin while not EOLn do begin write(input↑,' ');get(input)end end.

We can add −10 bytes if it is guaranteed that input is a non‑empty line:

program p(input,output);begin repeat write(input↑,' ');get(input)until EOLn end.

ARBLE, 17 bytes

gsub(s,".","%1 ")

Full Program.

Try it online!

Commodore C64 BASIC, 39 Tokenised BASIC bytes, 42 PETSCII characters with keyword abbreviations

0INPUTA$:FORI=1TOLEN(A$):?MID$(A$,I,1)" ";:NEXT

On running this listing, the interpreter will expect an input of strings which when the return key is pressed, will store the text entered into the variable A$. It will then iterate over each position of the string to its length and PRINT it, proceeded by a white space, and then will continue at the next cursor position until the final character of the string is printed (this will be followed by a space too).

Some notes: A Commodore C64 screen is 40 characters wide by default, and the maximum number of characters that may be stored in a string is 255, however, when using INPUT the interpreter will only accept a total entry of 77 characters without some trickery (80 characters if you delete the ? prompt, enter 80 characters and then cursor up two lines and press the RETURN key).

See screenshot for this in action.

Commodore C64 Full Width Text CodeGolf challenge

Nibbles, 3.5 bytes (7 nibbles)

+.@:$" "

Attempt This Online!

Explanation

+.@:$" "
  @       First line of stdin as a string (list of chars)
 .        Map this function:
    $       To each char,
   :        Append
     " "    A space
+         Concatenate the resulting list of strings together

Rockstar, 43 bytes

listen to S
cut S
join S with " "
say S+" "

Try it (Code will need to be pasted in)

Python, 30 Bytes

lambda x:' '.join(list(x))+' '

T r y i t o n l i n e !

Thunno 2 J, 2 bytes

ðṖ

Attempt This Online!

Port of Dennis's Jelly answer: cartesian product with space. J flag joins the list.

Pushy, 7 bytes

32DL:{'

Try it online!

Works like so:

       \ Implicit: Input is on stack as charcodes
32D    \ Set the printing delimiter to a space
L:     \ Input length times do:
  {    \   Cyclically shift the stack left
   '   \   Print the last character (includes trailing space)

Alternatively, for the same byte count, one could have:

L:{32;"

Try it online!

L:   ;   \ Length times do:
  {      \   Shift string left
   32    \   Insert char 32 (a space)
      "  \ Afterwards, print the whole string

Japt, 4 bytes

®+S

Try it online!

CLC-INTERCAL, 108 bytes.

DO;1<-#1DO;1SUB#1<-#117DO;2<-#1DOCOMEFROM#9DOWRITEIN;2(1)DO:1<-;2SUB#1DDOCOMEFROM':1~:1'~#1(9)DOREADOUT;2+;1

Copy and paste to try it online!

How it works

DONOTE ;1 has " "
DONOTE ;2 shall accept a character
DO;1<-#1
DO;1SUB#1<-#117
DO;2<-#1

DOCOMEFROM#9
  DOWRITEIN;2
  DONOTE if EOF, then :1 will be #0
  DONOTE otherwise it's at least #65536
  (1)DO:1<-;2SUB#1
  DONOTE error exit here
  D
  DONOTE come here if not EOF
  DOCOMEFROM':1~:1'~#1
(9)DOREADOUT;2+;1
```

Javascript, 19 bytes

s=>[...s,,].join` `

Factor + sequences.interleaved, 29 bytes

readln 32 <interleaved> print

Modern versions of Factor (i.e. not TIO) allow most sequences to be printed as strings. So have a screenshot of running this in the listener:

enter image description here

Silicon, 6 bytes

iSæ%æ+

Explanation:

iSæ%æ+
i        Input
 S       Split the input
  æ      Push a space
   %     Join at spaces
    æ+   Append a space to the end of the string
         Implicit output

7 bytes

iSæ²jæ+

Vyxal , 3 2 bytes

Ṅð

Try it Online!

Explanation:

     # Implicit input
Ṅ    # Insert ' ' between each character
  ð  # Push ' '
     # 'Ṫ' flag - sum entire stack and print

If the final space wasn't necessary:

Vyxal S, 0 bytes

Try it Online!

Explanation:

  # Implicit input
  # 'S' flag - Print top of stack joined by spaces

Grok, 13 bytes

:lYW!j
q}W Ih

I just finished my first Esolang and decided to submit a Code-golf answer with it to show it off. It's inspired by Befunge, ><>, and the Vim editor. More information on it is in the GitHub repository.

Zsh, 16 bytes

<<<${${1/// }# }

Try it online!

BRASCA, 10 bytes

![aEmmA{]x

Try it online!

Explanation

!           - Push stack length
 [a   A{]   - For i in range(0,stack_length)
   E        - Push a space
    mm      - Shift the stack twice
         x  - Remove the excess 0
<implicit>  - Output the stack reversed

naz, 50 42 40 bytes

2x1v1x1f0a0x1x2f1r3x1v1e1o0m8a4m1o2f0x2f

Works for any null-terminated input string.

Saved 8 bytes by condensing the code into 2 functions instead of 3!

Try it online!

Explanation (with 0x instructions removed)

2x1v                     # Set variable 1 equal to 0
1x1f0a                   # Function 1
                         # Add 0 to the register
1x2f1r3x1v1e             # Function 2
                         # Read a byte of input
                         # Goto function 1 if it equals variable 1
            1o0m8a4m1o2f # Otherwise, output it, output a space,
                         # then call function 2
2f                       # Call function 2

The only way for a naz program to know when to stop reading its input is to give it a special case to check for; here we use a null byte, since a value of 0 can be stored immediately.

05AB1E, 3 bytes

ðâJ

Try it online!

ðâJ  # full program
  J  # join...
 â   # cartesian product of...
     # implicit input...
 â   # and...
ð    # " "
     # implicit output

PowerShell, 17 8 bytes

-9 bytes thanks to @mazzy!

"$args "

Try it online!

There are already a couple of PowerShell answers to this question, but I thought I'd throw mine into the mix. It takes splatter input from a command line argument. It also assumes that $ofs is equal to one space, which it is by default.

C# (Visual C# Interactive Compiler), 44 bytes

Version reading an argument

Write(string.Join(" ",Args[0].ToList())+" ")

Try it online!

47 bytes

Version reading standard input

Write(string.Join(" ",ReadLine().ToList())+" ")

Try it online!

Keg, -rs, 3 bytes

( '

Shifts the input putting a space after each character, reverses the stack via the -rs flag and then implicitly outputs the stack.

W, 4 bytes

 "+M

Explanation

   M % Foreach the input list:
  +  % Join the current item with ...
 "   % ... A space character

Befunge-98 (PyFunge), 6 bytes

"#@~,,

Try it online!

The Befunge-98 answer is pretty long, so here is a shorter one. Basically the same answer as this Befunge-93 answer by Sp3000, but ends up being half as long, thanks to Befunge-98s ~ reflecting on EOF.

One thing that bugged me is, that when you run it on multi line input, every line but the first will be indented (since the linebreak will be followed by a space as well), so here is a version (11 bytes), that doesn't have that problem.

"#@~:,a-!j,

Try it online!

Zsh, 21 bytes

echo ${(s::)$(<&0)}\ 

Try it online!

$(capture), ${(s::)plit}, echo. The last "\ " is needed for the trailing space.

K (ngn/k), 10 bytes

{,/x,'" "}

Try it online!

(Ignored the stdin constraint. Let me know if I should delete, am new to SE)


EDIT: i made a mistake WRT stdin functionality in k. thanks, @ngn, for the correction:

K (ngn/k), 18 bytes

{1@,/(0:""),'" ";}

Try it online!


k4, 12 bytes

,/(0:0),'" "

which looks like:

 ,/(0:0),'" "
full-width text
"f u l l - w i d t h   t e x t "

C#, 105 bytes

public class P{public static void Main(string[]a){foreach(char c in a[0]){System.Console.Write(c+" ");}}}

EDIT: Removed space between string[] and a, also removed ToString as its not crucial saving a total of 12 bytes

Jelly, 5 3 2 bytes

Thanks to Dennis for saving 2 bytes. Also thanks to FryAmTheEggman for saving 1 byte. Code:

p⁶

Explanation:

p⁶   # Cartesian product with the input and the space character.

Uses the Jelly encoding.

Try it online!

Elixir, 55 43

Regex.replace(~r/(.)\n?/,IO.gets(""),"\\0 ")

Sadly, stripping the newline is pretty costly in terms of characters (not sure if I can remove it).

APL(NARS), 13 chars, 26 bytes

∊k,¨' '⍴⍨≢k←⍞

Input a line from standard input, and return a line, test:

∊k,¨' '⍴⍨≢k←⍞
hello there
h e l l o   t h e r e 

Japt -P, 2 bytes

ïS

Try it

ï      :Cartesian product with
 S     :  Space

PowerShell, 24 bytes

"$args"-replace'.','$0 '

Try it online!

Gol><>, 7 bytes

iEH}` }

Courtesy of JoKing, who golfed this to the max!!! JoKing combined the loops into one simple loop, also avoided the mistake I made, I added 2 spaces rather than one.

Try it online!

Slightly newer of My original golfed, 23 bytes

Ti:0)?t~l&T` }}&M:&?trH

Try it online!

Old version, 28 bytes

Ti:0)?t~l&T"  "}}}&M:&0)?trH

This can probably be golfed futher, but code breakdown below!

Ti:0)?t~l&T"  "}}}&M:&0)?trH

Ti:0)?t~                    //gets every char from input, and pushes them to the stack
          T"  "}}}          //push 2 spaces after every char, push to the bottom of the stack for later
        l&T       &M:&0)?t  //push original length and store, every loop decrement and if it is greater than zero, repeat
                          rH//reverse stack and output the whole stack as characters

Try it online!

Perl 6, 14 bytes

put get.comb,$

Try it online!

Prints a trailing newline.

Explanation:

put             # print to stdout
    get.comb    # the list of characters in the input, 
            ,$  # And an empty string
put             # Implicitly separated by spaces

C# (Visual C# Interactive Compiler), 44 bytes

for(int c;-1<(c=Read());Write((char)c+" "));

Try it online!

Not the first C# submission :) But it follows the challenge to the letter in terms of using STDIN and STDOUT.

Ahead, 8 bytes

~Wi@j '~

Try it online!

Brainfuck, 23 24 25 Bytes

1 Byte thanks to ovs

-[-[-<]>>+<]>-<+[,.>.<]

Try it online!
This code makes use of most interpreters wrapping to 255 if the number is negative.

Previous solution:

++++[>++++++++<-]+[,.>.<]

Try it online!

Explanation:

++++[>++++++++<-]   |Leaves the second cell with the number 32, the ASCII Code for a space.
+[,.>.<]            |Simple loop, gets the input, outputs it and adds a space.

Suggestions are welcome.

SMBF, 9 bytes

Note the trailing space. Uses the space in the code rather than creating a 32 in a cell.

,[.<.>,] 

The tryitonline.net interpreter appears to have a bug and loop indefinitely with this, so it only works in my Python interpreter. Changing the SMBF source code (currently on line 171) inside the Python code is required.

R, 36 bytes

cat(strsplit(readline(),"")[[1]],"")

Example:

> cat(strsplit(readline(),"")[[1]],"")
Hello R!
H e l l o   R ! 

k, 10 bytes

{,/x,'" "}

Explanation

{..} is the lambda syntax

x,'"" takes the first argument x, and applies the join operator , to every character, creating an array of "l " pairs

,/ folds the array with the join operator

Canvas, 4 3 bytes

 ]∑

Try it here!

Explanation:
   Push input to stack (implicit)
   For each character in the input: (implicit)
   Push the character to the stack (implicit)
   Push " " to the stack
] Collapse results from loop into an array
∑  Join the array into a single string
   Print the ToS (implicit)

-1 byte thanks to dzaima!

Stax, 2 bytes

Ties Jelly!

0\

Try it at staxlang.xyz!

All this does is push 0 to the stack and zip the string from standard input with it, repeating the 0 as necessary. In Stax, code point 0 in a string is usually converted to 32 (space).

This is short enough that packing it into ûT does nothing but reduce readability.

SmileBASIC, 39 bytes

LINPUT A$WHILE""<A$?SHIFT(A$);" ";
WEND

MATL, 7 bytes

32HY(1e

Try it Online!

Explanation

    % Implicitly grab input as a string
32  % Number literal (ASCII for ' ')
H   % Clipboard H contains 2 by default
Y(  % Fill the second "row" with spaces
1e  % Force everything onto one row. Due to MATLAB being row-major, this inserts the spaces
    % Implicitly display the result

Common Lisp, 40 bytes

(map()(lambda(x)(format t"~C "x))(read))

I was very surprised that format couldn't do this by itself: it can only iterate over lists, not strings.

Python 3, 95 93 92 80 32 26 30 bytes

Saved a byte thanks to @caird coinheringaahing

Saved bunch of bytes from @DJMcMayhem + My idea

print(' '.join(input())+' ')

Takes input, splits it, then prints a join with spaces

This is my first time golfing.

Standard ML (Mlton), 34 bytes

String.translate(fn c=>str c^" ");

Try it online! It turns out translate : (char -> string) -> string -> string from the String library is exactly the function needed for this task. The lambda fn c=>str c^" " takes a char, converts it to a string with the function str and prepends it to the string " ". translate applies this function to all chars and combines the resulting strings to a single string.


Other versions I found before stumbling over the translate function:

String.concatWith" "o map str o explode;
concat o map(fn c=>str c^" ")o explode;
foldr(fn(c,s)=>str c^" "^s)""o explode;
String.concatWithMap" "str o explode;    (* only in SML/NJ *)

Excel VBA, 21 19 Bytes

Anonymous VBE immediate window function that takes input from cell [A1] and outputs to the VBE immediate window

?StrConv([A1],64)" 

-1 Byte for removing & in ? statement

-1 Byte for removing terminal " from " "

Swift, 45 bytes

{$0.map{"\($0) "}.joined()}as(String)->String

Try it online!

SNOBOL4 (CSNOBOL4), 71 bytes

	I =INPUT
S	I LEN(1) . X REM . I :F(O)
	O =O X ' ' :(S)
O	OUTPUT =O
END

Try it online!

Rust, 49 Bytes

|mut x:String|{x.replace(""," ");x.remove(0);x}

it is an anonymous function, or lambda. It gets input from x, then modifies and returns it.

Python 3.5, 18 bytes

print(*input(),'')

This works because print's default separator is single space.

Python 3, 31 28

print(' '.join(input())+' ')

I know i'm late on this one, and definitely not a winner, but thought i'd try it out.

Edit: Switched to python 3. Thanks to CatsAreFluffy for saving 3 bytes!

Python 2.7, 62 Bytes

Yes, I know this is not as competitive with most of the other answers, but I wanted to use zip in some sort of way.

i=input();j=''.join;print(j([j(z)for z in zip(i,' '*len(i))]))

C, 56 Bytes (as program argument), 46 Bytes (from stdin)

main(int a,char**b){while(*b[1])printf("%c ",*b[1]++);}

Plain old C answer. Once compiled, the program needs to be called with a string as it's first parameter, a string with spaces needs to be enclosed in quotes. For the example in the start post:

./prog "Full width text is text that has a space after every character, including the last one."

Which will output

F u l l   w i d t h   t e x t   i s   t e x t   t h a t   h a s   a   s p a c e   a f t e r   e v e r y   c h a r a c t e r ,   i n c l u d i n g   t h e   l a s t   o n e .

Solution that reads directly from stdin.

main(c){while(c=~getchar())printf("%c ",~c);}

One byte less thanks to @FryAmTheEggman

Python 3, 39 bytes

print("".join([x+" "for x in input()]))

Java, 132 (System.in) or 99 (Program argument) bytes

Can you feel the overhead tonight?

class F{public static void main(String[]a){System.out.print(new java.util.Scanner(System.in).nextLine().replaceAll("(.)", "$0 "));}}
class W{public static void main(String[]a){for(char c:a[0].toCharArray())System.out.print(c+" ");}}

shooqie figured out a 6 byte shorter way to do this but I won't steal their approach. I've used it with the STDIN and lambda versions, however.

28 characters for a lambda but that doesn't meet the program requirement.

s->s.replaceAll("(.)","$0 ")

C, 50 bytes

Little bit of main() recursion :)

main(c){~(c=getchar())?printf("%c ",c),main():0;}

Try it online! - If using this on your own machine, use Ctrl+D to signify EOF.

C#, 137 bytes

Func<string,string>f=(a)=>{return string.Concat(a.ToCharArray().SelectMany(x=>(new char[] {' '}),(x, y)=>x.ToString()+y.ToString()));};

doing a console on it gives result : Console.WriteLine(f("arnab bhattacharya")); a r n a b b h a t t a c h a r y a

C#, 35 bytes

s=>string.Join(" ",s.ToList())+" ";

C# lambda where the input and the output are string. You can try it on .NetFiddle.

C 55, 49 bytes

g(){c;while((c=getchar())!='\n')printf("%c ",c);}

Ungolfed version:

void g()
{
  char c;
  while((c=getchar())!='\n')
  printf("%c ", c);
}

Python 2, 27 25 24 bytes

lambda x:' '.join(x)+' '

Shorter than Raffi's answer...

-1 thanks to 60919 (FlipTack).

C#, 52 bytes

Manual, straightforward approach, without using Linq.

s=>{var r="";foreach(var c in s)r+=c+" ";return r;};

Anonymous method which gets every character from the string and adds a space after each one.

Full program:

using System;

namespace FullWidthText
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string, string> f =
            s =>
            {
                var r = "";
                foreach (var c in s)
                    r += c + " ";
                return r;
            };

            Console.WriteLine(f("Full width text is text that has a space after every character, including the last one."));
        }
    }
}

C++ (gcc), 120 133 77 bytes

#import<iostream>
int main(){char c;while(std::cin.get(c))std::cout<<c<<" ";}

Thanks to my father, who showed me a nifty trick for getting the characters directly from the input stream... and in turn almost halfed my byte count!

Old solution below using getline and joining substrings:

#import<iostream>
int i;int main(){std::string s,n;std::getline(std::cin,n);for(;i<n.size();i++){s+=n.substr(i,1)+" ";}std::cout<<s;}

Try it Online!

My very first try on golfing. Feel free to give suggestions.

Julia, 31 bytes

print(join(readline(),' ')*" ")

Try it online!

MY, 8 bytes (noncompeting)

⍞ηυ←2Ġ'←

Try it online!

Explanation:

I originally was thinking of using a vecify command (would have cost a lot of bytes) but then I remembered I had the nice little υ.

APL (Dyalog), 4 bytes

Requires ⎕ML←0 which used to be standard

,⍪,∊

Try it online!

, ravel (flatten)

 the columnified argument

, followed by

 the prototypes (one space per character)

Taxi, 363 bytes

Go to Post Office:w 1 l 1 r 1 l.Pickup a passenger going to Chop Suey.[a]Go to Chop Suey:n 1 r 1 l 4 r 1 l.Switch to plan "z" if no one is waiting.Pickup a passenger going to Post Office.Go to Zoom Zoom:n 1 l 3 r." " is waiting at Writer's Depot.Go to Writer's Depot:w.Pickup a passenger going to Post Office.Go to Post Office:n 1 r 2 r 1 l.Switch to plan "a".[z]

Try it online!

Un-golfed / formatted:

Go to Post Office: west 1st left 1st right 1st left.
Pickup a passenger going to Chop Suey.
[a]
Go to Chop Suey: north 1st right 1st left 4th right 1st left.
Switch to plan "z" if no one is waiting.
Pickup a passenger going to Post Office.
Go to Zoom Zoom: north 1st left 3rd right.
" " is waiting at Writer's Depot.
Go to Writer's Depot: west.
Pickup a passenger going to Post Office.
Go to Post Office: north 1st right 2nd right 1st left.
Switch to plan "a".
[z]

Nothing fancy here. It's just an old challenge that Taxi is able to easily handle, a rare thing at times.

AHK, 37 bytes

Loop,Parse,1
Send,%A_LoopField%{VK20}

The variable 1 is the first passed argument. {VK20} is a space.

Brain-Flak, 46 bytes

{({}<>)<>}<>{({}<>)((((()()()()){}){}){})<>}<>

Try it online!

Explanation:

#Reverse the whole stack
{({}<>)<>}<>

#Reverse the whole stack, 
{({}<>)

    #Pushing 32 between each character
    ((((()()()()){}){}){})<>}<>

Vim, 12 10 keystrokes

:s/./& /g<CR>

1 byte longer:

qqa <Esc>l@qq@q

-2 bytes thanks to @KritixiLithos

q/kdb+, 12 bytes

Solution:

raze{x,'" "}

Example:

q)raze{x,'" "}"Hello World!"
"H e l l o   W o r l d ! "

Explanation:

,'   / join (,) each left ("H", "e", "l"...) with each right (" ")
raze / reduce list

Notes:

Would be 9 bytes doing it more directly rather than as a lambda function:

q)raze"Hello World!",'" "
"H e l l o   W o r l d ! " 

Carrot, 13 bytes, non-competing

#^//./gS" "^ 

(note trailing space in code)

Try it online!

(to be able to see the trailing space in the output, open up the JS console and select the outputted text in the console output)

Explanation

Note: the "stack" is actually just a string (not an array) in Carrot

#^                        // pushes the input `#` to the stack, now the stack == input
  /                       // split on:
   /./g                   //  every character in the stack

Now the program is in arrayMode, meaning that the stack is now an array (or stackA to be more precise)

       S" "               // join on spaces

Now we got spaces after every character except for the last one

           ^<space>       // append a space to the stack

And then the stack is implicitly outputted

SmileBASIC 3, 44 bytes

INPUT A$FOR I=0TO LEN(A$)-1?A$[I]+" ";
NEXT

This doesn't leave a new line after the output, so from direct you might get

?HELLO
H E L L O OK

but hopefully it's not an issue.

Lua, 57 bytes

t=""io.read():gsub(".",function(c)t=t..c.." "end)print(t)

Threead, 45 16 Bytes non-competing.

  B[coB]
32c   o

Takes input via STDIN.

The first Line/Tape simply reads bytes from STDIN, and writes them. The second line, initially stores a space via 32c, then at the same time that the next character is being read, outputs that space.

Try it online!

Cubix, 9 bytes

@./.i?>So

See it work online!

Cubix is a language in which the instructions are mapped out onto the face of a cube. This program forms the following cube net:

    @ .
    / . 
i ? > S o . . .
. . . . . . . .
    . .
    . .

The instruction pointer begins at i, which takes another character-code from input and pushes it to the stack. If there is no more input left to be taken, the ? turns the IP left, where it hits /, and is reflected upwards to @, which terminates the program.

However, if there is input left, the value will be a character code. As all1 character codes are positive, the ? makes the IP turn right, where it wraps all the way around the cube, passing o on the way which outputs the char. It then hits / which makes it loop back around to >So, which pushes and prints a space. The IP carries on west until wrapping around back to the i, back to the start of the main loop.

1 If the character is a null byte, it will ignore the ? and carry on straight ahead, simply outputting a single space.


Of course, there's only so much a written explanation can do, so I highly recommend you view this in the online interpreter. There's a "speed" option, which allows you to view the execution as slow or fast as you like.

OIL, 52 49 bytes noncompeting

Note: The second line contains a space character.

5

12
0
23
10
24
3
7
10
4
24
4
1
8
11
1
11
6
6
5

I explode the input string, then print each character and then a space.

PHP, 31 bytes

<?=chunk_split($argv[1],1," ");

takes input from command line argument.

TI-84 BASIC, 44 bytes

Pretty straightforward approach:

Input Str1
sub(Str1,1,1
For(A,2,length(Str1
Ans+" "+sub(Str1,A,1
End
Ans+" 

The only size optimizations I could come up with were:

This program wouldn't work correctly for an empty input string, since it unconditionally stores the first character of Str1 in Ans. (This is necessary because concatenation with an empty string raises an error!) Fortunately, the Input command doesn't accept an empty string in the first place.

The size calculation was informed by TI-Basic Developer's token size charts.

Cubix, 10 bytes

Cubix is a 2 dimensional language developed by @ETHproductions where the commands are wrapped onto a cube. Try it online

@.?wi^\oSo

This maps onto a cube with edge length 2

    @ .
    ? w
i ^ \ o S o . .
. . . . . . . .
    . .
    . .

Starts with a input i. The flow is redirected north ^ to the top face. ? If the value is negative turn left to finish @, zero carries on into shift right w or positive turn right then reflect left \. Output character with a trailing space oSo.

Batch, 87 bytes

@set/pt=&set w=
:l
@if not "%t%"=="" set w=%w%%t:~,1% &set t=%t:~1%&goto l
@echo(%w%

Conveniently taking input from STDIN is the same length as taking it from program arguments (set t=%*). The space between the % and & on the third line is significant, of course. The ( after the echo simply prevents it from erroring out if the input is empty.

Swift 2.2, 48 46 bytes

for c in i.characters{print(c,terminator:" ")}

Hey, at least it's shorter than Java... Saved 2 chars by using a for in loop instead of a forEach closure.

Lua, 31 Bytes

Saved 1 byte thanks to @LeakyNun

A simple chained substitution, replace each character by itself and a space.

s=(...):gsub(".","%1 ")print(s)

An other solution with the same byte count:

print((...):gsub(".","%1 "),'')

brainfuck, 24 22 bytes

Simple example using the shortest known 32 for the space character(s).

,[.>>-[-[-<]>>+<]>-.,]

Try it online

Tcl, 44 bytes

puts [regsub -all {(.)} [gets stdin] {\1 }]

Pyke, 5 bytes

dm+s_

Explanation:

d     -    load ' ' onto the stack
 m+   -   map(add, eval_input_or_not(), " ")
   s  -  "".join(^)
    _ - ^[::-1]

At the moment Pyke has a bug where if map is given a string, it reverses it :(

Or with a new fixed version, 3 bytes

dL+

Try it here!

left_map(input(), " ", add)

APL, 5 bytes

∊2∘↑¨

This takes 2 items for each character in the string, with the effect of adding a space

To make it a program that takes stdin, it's the same number of bytes:

∊2↑¨⎕

Try it here.

0815, 26 bytes

<:20:~>}: :!~$#:
:{~$>^: :

Pyth, 5 bytes

+jdzd

Test here

Explanation:

 jdz    Join input with spaces
+   d   Concatenate space

Hoon, 41 bytes

|*
*
`tape`(turn +< |=(@ (cat 3 +< ' ')))

Takes advantage of not having to specify the tape of a wet gate (|*), and that arguments are places at +< to prevent having to name them.

There are actually two different types of strings in Hoon: tapes, and cords. tapes are (list @tD), while cords are simply @t. Think the difference between a vector and an array: tapes can be indexed into and manipulated easily, while cords are "static" and basically just bignums.

This entry maps over the characters in the tape it gets as input, and adds on the value of ' ' to the end of the atom and then casts the result back to a tape.

Technically, this should probably be a type error: tape is a list of characters, and we are stuffing two in the space of only one. Luckily, while Hoon has syntax to say what you should expect the size of an atom to be, it doesn't actually enforce that expectation. Even slamming a too-big atom with a specific sized verification gate doesn't give back the default value like it should. Naturally, we abuse this and it even prints correctly in the console, as long as you don't try to full-width text any UTF-8 characters.

Usage:

> %.  "Full width text is text that has a space after every character, including the last one."
  |*
  *
  `tape`(turn +< |=(@ (cat 3 +< ' ')))
"F u l l   w i d t h   t e x t   i s   t e x t   t h a t   h a s   a   s p a c e   a f t e r   e v e r y   c h a r a c t e r ,   i n c l u d i n g   t h e   l a s t   o n e . "

Ouroboros, 11 bytes

i.0<5*(o32o

Ouroboros is an esolang in which every line of code represents a snake eating its tail. It draws a fair amount of inspiration from 2D languages like Befunge and ><>.

The i command reads a character, or -1 for EOF. We duplicate this, check if it's less than 0, and multiply the resulting 1 (true) or 0 (false) by 5.

Try it out

// Define Stack class
function Stack() {
  this.stack = [];
  this.length = 0;
}
Stack.prototype.push = function(item) {
  this.stack.push(item);
  this.length++;
}
Stack.prototype.pop = function() {
  var result = 0;
  if (this.length > 0) {
    result = this.stack.pop();
    this.length--;
  }
  return result;
}
Stack.prototype.top = function() {
  var result = 0;
  if (this.length > 0) {
    result = this.stack[this.length - 1];
  }
  return result;
}
Stack.prototype.toString = function() {
  return "" + this.stack;
}

// Define Snake class
function Snake(code) {
  this.code = code;
  this.length = this.code.length;
  this.ip = 0;
  this.ownStack = new Stack();
  this.currStack = this.ownStack;
  this.alive = true;
  this.wait = 0;
  this.partialString = this.partialNumber = null;
}
Snake.prototype.step = function() {
  if (!this.alive) {
    return null;
  }
  if (this.wait > 0) {
    this.wait--;
    return null;
  }
  var instruction = this.code.charAt(this.ip);
  var output = null;
  console.log("Executing instruction " + instruction);
  if (this.partialString !== null) {
    // We're in the middle of a double-quoted string
    if (instruction == '"') {
      // Close the string and push its character codes in reverse order
      for (var i = this.partialString.length - 1; i >= 0; i--) {
        this.currStack.push(this.partialString.charCodeAt(i));
      }
      this.partialString = null;
    } else {
      this.partialString += instruction;
    }
  } else if (instruction == '"') {
    this.partialString = "";
  } else if ("0" <= instruction && instruction <= "9") {
    if (this.partialNumber !== null) {
      this.partialNumber = this.partialNumber + instruction;  // NB: concatenation!
    } else {
      this.partialNumber = instruction;
    }
    next = this.code.charAt((this.ip + 1) % this.length);
    if (next < "0" || "9" < next) {
      // Next instruction is non-numeric, so end number and push it
      this.currStack.push(+this.partialNumber);
      this.partialNumber = null;
    }
  } else if ("a" <= instruction && instruction <= "f") {
    // a-f push numbers 10 through 15
    var value = instruction.charCodeAt(0) - 87;
    this.currStack.push(value);
  } else if (instruction == "$") {
    // Toggle the current stack
    if (this.currStack === this.ownStack) {
      this.currStack = this.program.sharedStack;
    } else {
      this.currStack = this.ownStack;
    }
  } else if (instruction == "s") {
    this.currStack = this.ownStack;
  } else if (instruction == "S") {
    this.currStack = this.program.sharedStack;
  } else if (instruction == "l") {
    this.currStack.push(this.ownStack.length);
  } else if (instruction == "L") {
    this.currStack.push(this.program.sharedStack.length);
  } else if (instruction == ".") {
    var item = this.currStack.pop();
    this.currStack.push(item);
    this.currStack.push(item);
  } else if (instruction == "m") {
    var item = this.ownStack.pop();
    this.program.sharedStack.push(item);
  } else if (instruction == "M") {
    var item = this.program.sharedStack.pop();
    this.ownStack.push(item);
  } else if (instruction == "y") {
    var item = this.ownStack.top();
    this.program.sharedStack.push(item);
  } else if (instruction == "Y") {
    var item = this.program.sharedStack.top();
    this.ownStack.push(item);
  } else if (instruction == "\\") {
    var top = this.currStack.pop();
    var next = this.currStack.pop()
    this.currStack.push(top);
    this.currStack.push(next);
  } else if (instruction == "@") {
    var c = this.currStack.pop();
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(c);
    this.currStack.push(a);
    this.currStack.push(b);
  } else if (instruction == ";") {
    this.currStack.pop();
  } else if (instruction == "+") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(a + b);
  } else if (instruction == "-") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(a - b);
  } else if (instruction == "*") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(a * b);
  } else if (instruction == "/") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(a / b);
  } else if (instruction == "%") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(a % b);
  } else if (instruction == "_") {
    this.currStack.push(-this.currStack.pop());
  } else if (instruction == "I") {
    var value = this.currStack.pop();
    if (value < 0) {
      this.currStack.push(Math.ceil(value));
    } else {
      this.currStack.push(Math.floor(value));
    }
  } else if (instruction == ">") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(+(a > b));
  } else if (instruction == "<") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(+(a < b));
  } else if (instruction == "=") {
    var b = this.currStack.pop();
    var a = this.currStack.pop();
    this.currStack.push(+(a == b));
  } else if (instruction == "!") {
    this.currStack.push(+ !this.currStack.pop());
  } else if (instruction == "?") {
    this.currStack.push(Math.random());
  } else if (instruction == "n") {
    output = "" + this.currStack.pop();
  } else if (instruction == "o") {
    output = String.fromCharCode(this.currStack.pop());
  } else if (instruction == "r") {
    var input = this.program.io.getNumber();
    this.currStack.push(input);
  } else if (instruction == "i") {
    var input = this.program.io.getChar();
    this.currStack.push(input);
  } else if (instruction == "(") {
    this.length -= Math.floor(this.currStack.pop());
    this.length = Math.max(this.length, 0);
  } else if (instruction == ")") {
    this.length += Math.floor(this.currStack.pop());
    this.length = Math.min(this.length, this.code.length);
  } else if (instruction == "w") {
    this.wait = this.currStack.pop();
  }
  // Any unrecognized character is a no-op
  if (this.ip >= this.length) {
    // We've swallowed the IP, so this snake dies
    this.alive = false;
    this.program.snakesLiving--;
  } else {
    // Increment IP and loop if appropriate
    this.ip = (this.ip + 1) % this.length;
  }
  return output;
}
Snake.prototype.getHighlightedCode = function() {
  var result = "";
  for (var i = 0; i < this.code.length; i++) {
    if (i == this.length) {
      result += '<span class="swallowedCode">';
    }
    if (i == this.ip) {
      if (this.wait > 0) {
        result += '<span class="nextActiveToken">';
      } else {
        result += '<span class="activeToken">';
      }
      result += escapeEntities(this.code.charAt(i)) + '</span>';
    } else {
      result += escapeEntities(this.code.charAt(i));
    }
  }
  if (this.length < this.code.length) {
    result += '</span>';
  }
  return result;
}

// Define Program class
function Program(source, speed, io) {
  this.sharedStack = new Stack();
  this.snakes = source.split(/\r?\n/).map(function(snakeCode) {
    var snake = new Snake(snakeCode);
    snake.program = this;
    snake.sharedStack = this.sharedStack;
    return snake;
  }.bind(this));
  this.snakesLiving = this.snakes.length;
  this.io = io;
  this.speed = speed || 10;
  this.halting = false;
}
Program.prototype.run = function() {
  this.step();
  if (this.snakesLiving) {
    this.timeout = window.setTimeout(this.run.bind(this), 1000 / this.speed);
  }
}
Program.prototype.step = function() {
   for (var s = 0; s < this.snakes.length; s++) {
    var output = this.snakes[s].step();
    if (output) {
      this.io.print(output);
    }
  }
  this.io.displaySource(this.snakes.map(function (snake) {
      return snake.getHighlightedCode();
    }).join("<br>"));
 }
Program.prototype.halt = function() {
  window.clearTimeout(this.timeout);
}

var ioFunctions = {
  print: function (item) {
    var stdout = document.getElementById('stdout');
    stdout.value += "" + item;
  },
  getChar: function () {
    if (inputData) {
      var inputChar = inputData[0];
      inputData = inputData.slice(1);
      result = inputChar.charCodeAt(0);
    } else {
      result = -1;
    }
    var stdinDisplay = document.getElementById('stdin-display');
    stdinDisplay.innerHTML = escapeEntities(inputData);
    return result;
  },
  getNumber: function () {
    while (inputData && (inputData[0] < "0" || "9" < inputData[0])) {
      inputData = inputData.slice(1);
    }
    if (inputData) {
      var inputNumber = inputData.match(/\d+/)[0];
      inputData = inputData.slice(inputNumber.length);
      result = +inputNumber;
    } else {
      result = -1;
    }
    var stdinDisplay = document.getElementById('stdin-display');
    stdinDisplay.innerHTML = escapeEntities(inputData);
    return result;
  },
  displaySource: function (formattedCode) {
    var sourceDisplay = document.getElementById('source-display');
    sourceDisplay.innerHTML = formattedCode;
  }
};
var program = null;
var inputData = null;
function showEditor() {
  var source = document.getElementById('source'),
    sourceDisplayWrapper = document.getElementById('source-display-wrapper'),
    stdin = document.getElementById('stdin'),
    stdinDisplayWrapper = document.getElementById('stdin-display-wrapper');
  
  source.style.display = "block";
  stdin.style.display = "block";
  sourceDisplayWrapper.style.display = "none";
  stdinDisplayWrapper.style.display = "none";
  
  source.focus();
}
function hideEditor() {
  var source = document.getElementById('source'),
    sourceDisplay = document.getElementById('source-display'),
    sourceDisplayWrapper = document.getElementById('source-display-wrapper'),
    stdin = document.getElementById('stdin'),
    stdinDisplay = document.getElementById('stdin-display'),
    stdinDisplayWrapper = document.getElementById('stdin-display-wrapper');
  
  source.style.display = "none";
  stdin.style.display = "none";
  sourceDisplayWrapper.style.display = "block";
  stdinDisplayWrapper.style.display = "block";
  
  var sourceHeight = getComputedStyle(source).height,
    stdinHeight = getComputedStyle(stdin).height;
  sourceDisplayWrapper.style.minHeight = sourceHeight;
  sourceDisplayWrapper.style.maxHeight = sourceHeight;
  stdinDisplayWrapper.style.minHeight = stdinHeight;
  stdinDisplayWrapper.style.maxHeight = stdinHeight;
  sourceDisplay.textContent = source.value;
  stdinDisplay.textContent = stdin.value;
}
function escapeEntities(input) {
  return input.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function resetProgram() {
  var stdout = document.getElementById('stdout');
  stdout.value = null;
  if (program !== null) {
    program.halt();
  }
  program = null;
  inputData = null;
  showEditor();
}
function initProgram() {
  var source = document.getElementById('source'),
    stepsPerSecond = document.getElementById('steps-per-second'),
    stdin = document.getElementById('stdin');
  program = new Program(source.value, +stepsPerSecond.innerHTML, ioFunctions);
  hideEditor();
  inputData = stdin.value;
}
function runBtnClick() {
  if (program === null || program.snakesLiving == 0) {
    resetProgram();
    initProgram();
  } else {
    program.halt();
    var stepsPerSecond = document.getElementById('steps-per-second');
    program.speed = +stepsPerSecond.innerHTML;
  }
  program.run();
}
function stepBtnClick() {
  if (program === null) {
    initProgram();
  } else {
    program.halt();
  }
  program.step();
}
function sourceDisplayClick() {
  resetProgram();
}
.container {
    width: 100%;
}
.so-box {
    font-family:'Helvetica Neue', Arial, sans-serif;
    font-weight: bold;
    color: #fff;
    text-align: center;
    padding: .3em .7em;
    font-size: 1em;
    line-height: 1.1;
    border: 1px solid #c47b07;
    -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3), 0 2px 0 rgba(255, 255, 255, 0.15) inset;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    background: #f88912;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3), 0 2px 0 rgba(255, 255, 255, 0.15) inset;
}
.control {
    display: inline-block;
    border-radius: 6px;
    float: left;
    margin-right: 25px;
    cursor: pointer;
}
.option {
    padding: 10px 20px;
    margin-right: 25px;
    float: left;
}
h1 {
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
}
a {
    text-decoration: none;
}
input, textarea {
    box-sizing: border-box;
}
textarea {
    display: block;
    white-space: pre;
    overflow: auto;
    height: 50px;
    width: 100%;
    max-width: 100%;
    min-height: 25px;
}
span[contenteditable] {
    padding: 2px 6px;
    background: #cc7801;
    color: #fff;
}
#stdout-container, #stdin-container {
    height: auto;
    padding: 6px 0;
}
#reset {
    float: right;
}
#source-display-wrapper , #stdin-display-wrapper{
    display: none;
    width: 100%;
    height: 100%;
    overflow: auto;
    border: 1px solid black;
    box-sizing: border-box;
}
#source-display , #stdin-display{
    font-family: monospace;
    white-space: pre;
    padding: 2px;
}
.activeToken {
    background: #f93;
}
.nextActiveToken {
    background: #bbb;
}
.swallowedCode{
    color: #999;
}
.clearfix:after {
    content:".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}
.clearfix {
    display: inline-block;
}
* html .clearfix {
    height: 1%;
}
.clearfix {
    display: block;
}
<!--
Designed and written 2015 by D. Loscutoff
Much of the HTML and CSS was taken from this Befunge interpreter by Ingo Bürk: http://codegolf.stackexchange.com/a/40331/16766
-->
<div class="container">
<textarea id="source" placeholder="Enter your program here" wrap="off">i.0<5*(o32o</textarea>
<div id="source-display-wrapper" onclick="sourceDisplayClick()"><div id="source-display"></div></div></div><div id="stdin-container" class="container">
<textarea id="stdin" placeholder="Input" wrap="off">Input text...</textarea>
<div id="stdin-display-wrapper" onclick="stdinDisplayClick()"><div id="stdin-display"></div></div></div><div id="controls-container" class="container clearfix"><input type="button" id="run" class="control so-box" value="Run" onclick="runBtnClick()" /><input type="button" id="pause" class="control so-box" value="Pause" onclick="program.halt()" /><input type="button" id="step" class="control so-box" value="Step" onclick="stepBtnClick()" /><input type="button" id="reset" class="control so-box" value="Reset" onclick="resetProgram()" /></div><div id="stdout-container" class="container"><textarea id="stdout" placeholder="Output" wrap="off" readonly></textarea></div><div id="options-container" class="container"><div class="option so-box">Steps per Second:
<span id="steps-per-second" contenteditable>20</span></div></div>

Pip, 5 bytes

_.sMq

The special variable q reads a line of stdin. We Map to it the lambda function _.s, which concatenates a space to each character. By default, the resulting list is concatenated and autoprinted.

MATLAB, 25 bytes

@(s)reshape([s;0*s],1,[])

Creates an anonymous function that can be then called using ans('input string').

Exploits that fact that a null character is displayed as a space in MATLAB. Therefore [s;0*s] appends a new row that is all spaces. Then using reshape flattens this back out into a string but the spaces are inter-spersed due to the row-major ordering.

Octave, 18 bytes

@(s)[s;32+0*s](:)'

Creates an anonymous function. Can then be run using ans('input string')

Same rationale as my MATL answer. Takes advantage of the fact that you can flatten (:) an array in Octave prior to assignment to a variable.

MATL, 7 bytes

tnZ"v1e

Try it online!

Explanation

t    % implicitly take input string and duplicate it
n    % number of elements
Z"   % string with that many spaces
v    % concatenate vertically (2xN array, where N is input length)
1e   % reshape into 1 row. Implicitly display

beeswax, 20 bytes

p?Cy ?<~1V_
>` `Ag'b

Example:

julia> beeswax("Full Width Text.bswx")
sHello, World!
H e l l o ,   W o r l d !
Program finished!

Explanation:

             lstack    gstack

          _  [0,0,0]•  []•                          create bee
         V   [0,0,0]•  [72,101,108,108,111,10]•     read in string to gstack
        1    [0,0,1]•                               lstack 1st=1
       ~     [0,1,0]•                               flip lstack 1st and 2nd
      <      [0,0,0]•                           (1) redirect to left
     ?       [0,1,0]•  [72,101,108,108,111]•        pop gstack top value (\n)
   y         [0,1,0]•  [101,108,108,111,72]•        rotate gstack down by lstack[-,steps,depth]•
                                                    depth=0 defaults to full stack length
  C                    STDOUT='H'                   print gstack top value as Char to STDOUT
 ?                     [101,108,108,111]•           pop gstack top value
p                                                   redirect to lower left
>                                                   redirect to right
 ` `                   STDOUT=' '                   print space char to STDOUT
    A                  [101,108,108,111,4]•         push gstack length on top of gstack
     g       [0,1,4]•                               lstack 1st=gstack top
      '                                             skip next if lstack 1st=0
       b                                            redirect to upper left
      <                                             loop back to (1)
     ?                 [101,108,108,111]•
   y         [0,1,4]•  [108,108,111,101]•
  C                    STDOUT='e'
 ?                     [108,108,111]•
p
>` `                   STDOUT=' '

.                          .                             .
.                          .                             .
.                          .                             .

Gema, 5 bytes

?=?\ 

Sample run:

bash-4.3$ gema '?=?\ ' <<< 'Full width text.'
F u l l   w i d t h   t e x t . 

Hexagony, 21 13 12 10 bytes

Code:

Saved a lot of bytes thanks to FryAmTheEggman. Code:

P,<0/*;@.>

Or in a more readable form:

  P , <
 0 / * ;
@ . > . .
 . . . .
  . . .

Try it online!

Explanation:

The Hexagony program starts at the top-left corner, immediately setting the memory edge to the ASCII value of P, which is 80. After that, we can see that the following path is taken:

enter image description here

We can see that the path taken is: P,<;.P/0....;*/>. After the P, we take a byte of user input. If this is empty, the following branch (<) would direct us to the North East. If the input is non-empty, the branch directs us to the South East. After that, we output the user input using ;. We set the memory edge back to P, which is 80. The zero followed by the mirror is then concatenated to our number, resulting into 800. This is then outputted using the ; command, but first it is taken modulo 256, resulting into 32, which is the space character. After that, we reset the memory edge using the * command and return to loop over the rest of the user input. When we're done with the user input, the path is directed to the North East:

enter image description here

This basically goes to the @ command, which terminates the program.

Using Timwi's amazing HexagonyColorer for making the diagrams.

Befunge-93, 18 bytes

>~:1`#v_@
^," ",<

Matlab/Octave, 51 bytes

s=s(.5:.5:length(s))
s(1:2:length(s))=' '

Sed, 8 bytes

's/$*/ /g'

Can be run from bash as

$ sed 's/$*/ /g' <<< "Full Width Text."

Outputs

 F u l l   w i d t h   t e x t .

Japt, 5 bytes

U¬¸+S

Try it here.

Labyrinth, 11 bytes

32@
 :,
 ..

This is an 11-byte answer which terminates without an error – see @MartinBüttner's answer for a 10-byte answer which terminates with an error. Try it online!

Starting from the top-left, we have the following setup step:

32        Turn a zero at the bottom of the stack into 32 (space)

Then we turn right at the 2, entering the following tight loop:

:          Duplicate top of stack (space)
,          Read char from STDIN
.          Output char
.          Output space

This loop repeats until , reads EOF, which pushes -1 to the top of the stack. The -1 makes us turn left into the @, terminating the program.


Here are two additional error-free 11-byte solutions, by Martin:

Extra version A

  3
.:2
.,@

This version is the same as the above, but rotated 90 degrees. We still start on the 3, since this is the first valid instruction in reading order.

Extra version B

^,.
@:.
2
3

This version is effectively the same as the previous two, but uses an initial ^ to rotate the first column upon running the program, such that the board becomes:

@,.
2:.
3
^

After this, the code is the same as the original, except rotated 90 degrees in the other direction.

Prelude, 11 bytes

?(!8^+^+!?)

This needs a spec-compliant interpreter which reads and writes character codes (instead of integers).

The program is fairly simple.

?(...?)

This sets up a while(read() != EOF) loop. Then we simply have:

!   Print input character.
8   Push 8.
^+  Duplicate, add. Gives 16.
^+  Duplicate, add. Gives 32.
!   Print space.

Labyrinth, 10 bytes

<.23.%):,>

This terminates with an error, but the error messages goes to STDERR.

Try it online!

Explanation

This is one of the rare cases where a completely linear program is feasible. The loop is achieved via the source code modification commands < and >, which works because after each iteration we know that the stack is empty again.

< cyclically shifts the entire line one cell to the left, so we end up with:

.23.%):,><

This takes the instruction pointer (IP) with it so the IP is now at the right end of the code and has to move left. Next, the > does the opposite modification so it shifts the source code back to

<.23.%):,>

Now we execute a single iteration (from right to left), before everything starts over:

,    Read a character code from STDIN, or -1 at EOF.
:)   Duplicate and increment.
%    Modulo. At EOF this will attempt a division by zero and terminate. Otherwise, we
     have n % (n+1) = n, so we're left with the input character again.
.    Print it back to STDOUT.
32   Turn the top of the stack into a 32.
.    Print it as well (a space).

WhoScript 38 bytes

1v;pr;e;#0 1;-;i;t=;ti;o;tl;" ";d;>;pf

Works best when the string is given at the command line, but it can be done one character at a time in real time as well.

Ungolfed:

time_vortex
  psychic_paper read
  duplicate
  # 0 1
  -
  integer
  TARDIS =
  TARDIS if
      opening
  TARDIS landing
  # 20
paradox
pop
psychic_paper flush

PowerShell, 32 bytes

-join([char[]]$args[0]|%{"$_ "})

Explanation

Take in the input to the function and convert it to a char array. Add one space to each character and rejoin. Nothing really fancy here.

J, 8 bytes

,@,.&' '

,. is the stitch command, and ' ' , 'string' creates a table with a space following each character. , takes these items out of the table when used as a monad, and @ composes this function with our other function. Use:

   fullWidth =: ,@,.&' '
   fullWidth 'this text is full width!'
   fullWidth 'this text is full width!'
t h i s   t e x t   i s   f u l l   w i d t h ! 

Great thanks to Zgarb who helped me make this answer.

Befunge-93, 12 bytes

~:1+!#@_, ",

Tested using this online interpreter.

~                           Read char
 :1+!                       Push (char == -1)
     #@_                    Halt if so, i.e. on EOF
        ,                   Output char
          "~:0`!#@_, "      Push the chars between the quotes, one by one
                      ,     Output the top char, i.e. space

𝔼𝕊𝕄𝕚𝕟, 5 chars / 7 bytes

ᴉü⬭+⬭

Try it here (Firefox only).

Short and sweet. Get input split along chars and join with space.

Befunge-98, 21 bytes

>  ~:av
^,*84,w
@,*84,<

Lengthier than one already present but has the ending space requested by OP.

Pyth, 5 4 bytes

Thanks to @FryAmTheEggman for saving a byte.

s*zd

Try it online here.

PHP, 39 bytes

echo join(' ',str_split($argv[1])).' ';

Run it from the command line

php fullwidth.php "Full width text is text that has a space after every character, including the last one."

https://eval.in/541179

Javascript, 35 chars

Full program

alert(prompt().replace(/./g,"$& "))

Javascript ES6, 24 chars

Just a function

s=>s.replace(/./g,"$& ")

Perl 5, 11 10 + 1 flags = 11 bytes

really, the same as the Perl 6 one, but the sed syntax changed.

s/./$& /g

example:

perl -pe "s/./$& /g" <<< abc

old:

perl -pne "s/(.)/\1 /g" <<< abc

O 1.2, 6 bytes

I' ]^o

Sample run:

bash-4.3$ java xyz.jadonfowler.o.O <(echo "I' ]^o") <<< 'Full width text.'
F u l l   w i d t h   t e x t . 

This could be 5 characters in O 2 as IT]^o, but sadly it not seems to fully support the ^ command yet.

Convex, 3 bytes

Convex is a new language that I am developing that is heavily based on CJam and Golfscript. The interpreter and IDE can be found here. Input is an integer into the command line arguments. Indexes are one-based. Uses the CP-1252 encoding.

S*S

Explanation:

     # Implied input
S*   # Join by spaces
  S  # Add a space at the end
     # Implied output

Additionally, @DonMuesli's CJam answer without the l (so Sf+) will also work for 3 bytes.

Clojure, 34 bytes

#(apply str(mapcat(fn[x][x" "])%))

Clojure is amazingly fun to work with but annoying to golf. Usually there's a really nice idiomatic solution to these challenges that isn't that many identifiers, but it's massive thanks to things like the identity function being identity (not fully golfed in these forms):

(defn fw [s] (apply str (interleave s (repeat " "))))

or

(defn fw [s] (apply str (mapcat (juxt identity (constantly " ")) s)))

RETURN, 10 bytes

`""¨{' °},

Try it here.

Takes input from STDIN. It's just take STDIN, split along chars, join with space, output.

Jolf, 7 bytes

Try it here!

p4i*li♣
p4       interweave
  i      the input
   *li♣  with a string of spaces with = length to the input

Retina, 5

.
$& 

Note the space at the end of the second line.

$& is equivalent to $0. Thanks to @mbomb007 for this link.

Try it online.

Reng v.1.2, 15 bytes

Try it out here! The input is given as "input".

ai p|$raoWo?!|~

a is a one-way mirror from the left. ai p| gets all input, $ drops the residual -1 not found input, r reverses the stack, and aoWo?!|~ is an output loop. W pushes 32, the space, and outputs it after outputting the character. ?! breaks out if not true, and ~ ends the program.

><>, 13 10 bytes

3 bytes saved thanks to @Sp3000

i:0(?;o 'o

Try it here. Click the link, then Submit, then type some input and press Give, and finally run the program with Start or Run without animation.

Explanation

i       read a character
:       duplicate
0(      is it less than 0?
?;      if so: end program. Else:
o       output read character
 '      push all chars until matching (same) quote. Top character is a space
o       output that character, which is a space. Go back to the beginning

Nim, 41 bytes

for c in stdin.readAll:stdout.write c&' '

I sure hope there's a better way, but readChar didn't seem to help...

Ideone link

JavaScript, 20 Bytes

Simple, I just wish that Array.join added the space to the end so I could save 3 bytes.

s=>[...s,``].join` `

Ruby, 24 15 bytes

gsub /./,'\0 '

Requires the -p flag (byte added).

Thanks to xsot for 9 bytes!

Mathematica, 42 bytes

Print@@(#<>" "&)/@Characters@InputString[]

Pretty self-explanatory. InputString takes a line from STDIN, Characters converts it to a list of characters, (#<>" "&)/@ produces a new string with spaces after those characters, and Print prints the result.

Ruby, 41 bytes

puts gets.chomp.chars.map{|e|e+" "}.join

chomp eats trailing newlines.

Grond, 22 21 chars

a(p().sp('').jn(' '))

Edit: removed semicolon
compiler in js below

String.prototype.reverse = function() {
  return this.split("").reverse().join("");
}
function compile(source){
var wc = source; // wc stands for working copy 
var lastWC;
while (true) {
  lastWC = wc;
  wc = wc.reverse();
  wc = wc.replace(/\(a(?!\w)/, "(trela"); //alert ,a
  wc = wc.replace(/\(f(?!\w)/, "(rof"); // for, f
  wc = wc.replace(/\(w(?!\w)/, "(elihw"); //while,w
  wc = wc.replace(/\(p(?!\w)/, "(tpmorp"); //prompt,p
  wc = wc.replace(/\(vr\./, "(esrever."); //reverse, rv
  wc = wc.replace(/\(tm\./, "(chtam."); // match, mt
  wc = wc.replace(/\(nj\./, "(nioj."); //join, .jn
  wc = wc.replace(/\(pr\./, "(ecalper."); //replace, .rp
  wc = wc.replace(/\(ls\./, "(.ecils"); //slice, sl
  wc = wc.replace(/\(lt\./, "(esaCrewoLot."); //toLowerCase, tl
  wc = wc.replace(/\(ut\./, "(esaCreppUot."); //toUpperCase, tu
    wc = wc.replace(/\(ps\./, "(tilps."); //split, sp
  wc = wc.reverse();
  wc = wc.replace(/\.l(?!\w)/, ".length"); // .length, .l
  if (lastWC === wc)
    break;
}

// quine builtin commented out because it messes things up TODO: Fix it. 
wc = " String.prototype.la=function(h){var x=this.split(''); x[h] = x[h].toLowerCase(); return x.join('');};String.prototype.ca=function(h){var x=this.split(''); x[h] = x[h].toUpperCase(); return x.join('');};String.prototype.reverse=function(){return this.split('').reverse().join('');}; \n var h = ['hello, world', 'Hello, World', 'Hello, World!', 'hello, world!', 'hello world', 'hello world!', 'Hello World', 'Hello World!', 'Hello, world.', 'Hello, World.' ,'hello world.' , 'Hello World.']; /* var q ='" + source + "';*/ " + wc;

return wc;
  }
eval(compile("a(p().sp('').jn(' '));"));//source
Grond on github: https://github.com/epicTCK/Grond

Scala, 35 bytes

Console.readLine.map(_+" ")mkString

Example:

scala> Console.readLine.map(_+" ")mkString
res1: String = "H e l l o   S c a l a ! "

PS. A function would be slightly shorter (32 bytes):

(s:String)=>s.map(_+" ")mkString

LiveScript, 17.

->"#{it/''*' '} "

Go, 154 120 bytes

package main
import(
."fmt"
."os"
."strings")
func main(){s:=Join(Args[1:], " ")
for _,c:=range s{Print(string(c)," ")}}

Saved a few bytes with command line args.

Awk, 7 bytes

(4 characters code + 3 characters command line option.)

NF++

Sample run:

bash-4.3$ awk -F '' 'NF++' <<< 'Full width text.'
F u l l   w i d t h   t e x t . 

(There is some disagreement on what should be included in the command line option count. I included what is actually passed to the awk interpreter: “-”, “F” and a separator between “F” and the empty string parameter. See below what I mean.)

bash-4.3$ od -tax1 /proc/`pidof awk`/cmdline 
0000000   a   w   k nul   -   F nul nul   N   F   +   + nul
         61  77  6b  00  2d  46  00  00  4e  46  2b  2b  00
                         ╰────────╯

Vitsy, 10 bytes

zl\[O' 'O]

z          Grab all string input.
 l\[     ] Do the stuff in the brackets length of the stack times.
    O   O  Output as character.
     ' '   Push literal space.

Try it online!

Java, 92

class T{public static void main(String[]A){System.out.print(A[0].replaceAll("(.)","$0 "));}}

GolfScript, 6 bytes

' ':n*

Try it online!

sed, 8 bytes

s/./& /g

When running this from the shell you should quote it of course e.g.

echo Full Width Text | sed 's/./& /g' | od -c

CJam, 5 4 bytes

1 byte fewer thanks to @FryAmTheEggman

lSf+

Try it online!

Explanation

l     e# read line
Sf+   e# map "concatenation" (+) with a space (S) as extra parameter
      e# implicitly display characters in the stack

05AB1E, 4 bytes

Sð«J

Try it online.

Explanation

Sð«J

S     split string into a list
 ð«   append a space to each element
   J  join

Minkolang 0.15 - 9 bytes

od?.O" "O

Try it here!

Explanation

o            Take character from input
 d           Duplicate top of stack
  ?.         Pop top of stack and jump over the . if truthy, stop otherwise
    O        Output input char
     " "O    Output a space

Minkolang's codebox is toroidal, hence there is no need to put an explicit loop in it.

Haskell, 11 bytes

((:" ")=<<)

Usage example: ((:" ")=<<) "Code Golf" -> "C o d e G o l f ".

Map each character c to a two element list [c, space] and concatenate everything into a single list.

Seriously, 7 bytes

' ;,@j+

Try it online!

Man, that required ending space added 3 additional bytes. Without it, ,' j would work for 4.

Explanation:

' ;,@j+
' ;      push two copies of a single space
   ,@    push input, swap
     j+  join on spaces, append a space