\lowercase with \IfSubStr and \StrDel

The primitive \lowercase is not expandable; you have to first lowercase the argument and then use the lowercased string:

\documentclass{article}
\usepackage{xstring}

\newcommand{\mylist}{one,two,three}

\newcommand{\checkinlist}[1]{%
  \lowercase{\def\temp{#1}}%
  \StrDel{\temp}{ }[\temp]%
  \IfSubStr{\mylist}{\temp}{yes}{no}%
}

\begin{document}

\checkinlist{one}

\checkinlist{One}

\checkinlist{o N e}

\checkinlist{o N f}

\end{document}

enter image description here


Here's an expl3 version

\documentclass{article}

\usepackage{xparse}

\newcommand{\mylist}{one,two,three, egreg was faster}

\ExplSyntaxOn
\newcommand{\CheckInList}[2]{%
  \tl_set:Nx \l_tmpa_tl {\text_lowercase:n {#1}} %transform the list lowercase
  \clist_set:Nx \l_tmpa_clist {\l_tmpa_tl} % make a real list
  \tl_set:Nx \l_tmpb_tl {\text_lowercase:n {#2}} % lower case second arg
  \clist_if_in:NVTF \l_tmpa_clist {\l_tmpb_tl} {Yes!} {No!} % Check if #2 is in the list
}
\ExplSyntaxOff
\begin{document}

\CheckInList{\mylist}{One}

\CheckInList{\mylist}{two}

\CheckInList{\mylist}{Egreg was faster}

\CheckInList{\mylist}{Should egreg get the tick?}

\end{document}

enter image description here