try this before calling the function
if instr(your text,"characters") > 0 then
'''do your stuff'''
end if
this will help you to find if char or no char are present in the text