Julia, 165 155 151 129129 102 bytes
s->(x=splitg(s,r"\W",keep=1<0d=[]);d=r=[];for i=1:endof=join(x);filter(i->i!=0,[(c=lcfirst(x[i]w)[1])∈d?(r=[r;i])0:(d=[d;c]d=[d;c];w)end;deleteat!for w=split(xs,rr"\W",keep=1<0);join(x])," "))
This is an anonymousa function that accepts a string and returns a string. To call it, assign it to a variable.
Ungolfed:
function fg(s, d=[])
# Split on unwanted characters, omitting them from the array
string into an array xon =unwanted split(scharacters, r"\W",then keep=false)
for
# Initialize an arrayeach toword, holdif the indicesfirst ofletter wordshas tobeen removeencountered, populate
# as well as onethis toelement holdof the first letters ofarray eachwith word
0, otherwise note the dfirst =letter
r = []
# and use #the Locateword. allThis indicesresults forin removalan byarray checkingof thewords firstand letterzeros.
#x of= each[(c word= againstlcfirst(w)[1]) the∈ firstd letters? of0 the: remaining(d words
= [d; c]; w) for iw = 1:endofsplit(xs, r"\W", keep=1<0)]
# Remove the (czeros, =keeping lcfirst(x[i])[1])only ∈the dwords. ?Note (rthat =this [r;works
i]) : (d =# [d;even c])
if the word is end
the string "0" since #0 Remove!= words"0".
from the array byz index
= filter(i -> i deleteat!(x= 0, rx)
# Join the array back into a string, separated byand spacesreturn
return join(xz, " ")
end
Saved 2653 bytes with help from Sp3000!