I have this text :
He's a self made man who gets what he wants.
The small blue forget me not flower was first used by the Grand Lodge.
And this function:
function MyFunction()
let myList1 = ["self made man", "gorget me not"]
for elem in MyList1
if search("=/elem", 'W') == 0
echo "I want to replace space by hyphen between this three words"
---> CODE
endif
endfor
endfunction
I want to get this text after executing the function :
He's a self-made-man who gets what he wants.
The small blue forget-me-not flower was first used by the Grand Lodge.
Can you help me to write the missing line (---> CODE
) ?