• But, if it contains both strings, you'll get it in the output twice. You may need a DISTINCT.

    Also, you're not really using the CROSS APPLY functionality. This could just as easily be a JOIN (using ON instead of WHERE), since your function isn't using anything from @vTable, so it doesn't need to be re-executed for each row.