I Have this function :
function! Test1() let myWord = "accroche-coeur" let cont1 = "-" if match(myWord,cont1)>=0 " if myWord contains cont1 echo "Ok" else echo "No" endif endfunction
I vould like make a function like that :
function! Test2() let cont1 = "irr" let myRep = "YesOrNo" silent! exe '1,1 s/[A-Z-a-z-à-ù]*[A-Z-a-z-à-ù]/\=execute(if (search,cont1)>=0 then myRep="Yes" endif)' echo myRep endfunction
Could you tell me please what I have to insert between the parenthesis of execute( ... ) for that returns "Yes" if my text contains cont1.
For example, if I have this text :
Books are the mirror of the soul.
This function has to return "Yes"