You can test each item in the first string for being in the second string; at any “non match” stop and return false.
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\checkTF}{mmmm}
{
\stringchecker_if_string_in:nnTF { #1 } { #2 } { #3 } { #4 }
}
\bool_new:N \l__stringchecker_temp_bool
\prg_new_protected_conditional:Nnn \stringchecker_if_string_in:nn { T, F, TF }
{
% set the temporary boolean to true; it will remain such
% unless a nonmatch will happen
\bool_set_true:N \l__stringchecker_temp_bool
% map over the substring to find
\str_map_inline:nn { #1 }
{
% do nothing if there is a match; ##1 is the current item, #2 the string to search in
\str_if_in:nnF { #2 } { ##1 }
{
% a nonmatch breaks the mapping and sets the boolean to false
\str_map_break:n { \bool_set_false:N \l__stringchecker_temp_bool }
}
}
\bool_if:NTF \l__stringchecker_temp_bool
{% there was no nonmatch, return true
\prg_return_true:
}
{% a nonmatch was found, return false
\prg_return_false:
}
}
\ExplSyntaxOff
\begin{document}
\checkTF{asdf}{asdfgh}{TRUE}{FALSE}
\checkTF{asdf}{hgfdsa}{TRUE}{FALSE}
\checkTF{asdf}{asdghj}{TRUE}{FALSE}
\checkTF{}{asdghj}{TRUE}{FALSE}
\checkTF{a}{}{TRUE}{FALSE}
\end{document}

A slightly more efficient version that absorbs one token at a time from the first argument.
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\checkTF}{mmmm}
{
\stringchecker_if_string_in:nnTF { #1 } { #2 } { #3 } { #4 }
}
\prg_new_protected_conditional:Nnn \stringchecker_if_string_in:nn { T, F, TF }
{
\__stringchecker_check:nN { #2 } #1 \q_nil
}
\cs_new_protected:Nn \__stringchecker_check:nN
{
\quark_if_nil:NTF #2
{
\prg_return_true:
}
{
\str_if_in:nnTF { #1 } { #2 }
{
\__stringchecker_check:nN { #1 }
}
{
\__stringchecker_stop:w
}
}
}
\cs_new:Npn \__stringchecker_stop:w #1 \q_nil
{
\prg_return_false:
}
\ExplSyntaxOff
\begin{document}
\checkTF{asdf}{asdfgh}{TRUE}{FALSE}
\checkTF{asdf}{hgfdsa}{TRUE}{FALSE}
\checkTF{asdf}{asdghj}{TRUE}{FALSE}
\checkTF{}{asdghj}{TRUE}{FALSE}
\checkTF{a}{}{TRUE}{FALSE}
\end{document}
\test{{é}{ç}{à}}{pàqçzé},\test{{é}{ç}{à}}{pàqzé}, with pdflatex (not with lualatex, xelatex). This applies to Babel shorhands too, naturally. And, with braces you can apply\mycheckalso to macros, even undefined\mycheck{{\error}{\undefined}}{\a\b\error\c\undefined\d}{TRUE}{FALSE}(can't use\testhere which will try to "print"#1={\error}{\undefined}and#2same problem) – Jan 13 '19 at 18:14\in@trueor\in@falsebefore the\xintFor*loop depending on what is expected in case of empty list replacing theasdfof example. – Jan 14 '19 at 10:32