Is there a package that provides a command for testing whether a string is in a list? I saw several answers that define their own commands to perform this or similar tasks, but I prefer a "self-evolving", and well-documented solution for this kind of tasks. More precisely, the command should be something like this
\IfStringInList{string}{list}{DoThisIfTrue}{DoThisIfFalse}
For instance
\IfStringInList{Paul}{George,John,Paul,Ringo}{Beat it}{Roll it}
EDIT: I'm not against defining commands. I expected thas this natural functionality was present in a ready-to-use package, that can be accessed in a very simple way.
{}{}{}..., for instance, is not. – ASdeL Aug 11 '15 at 16:29\in@and\ifin@are predefined in the latex format. – David Carlisle Aug 11 '15 at 16:36makeatletter/makeatother?. I would like a plain simple command. – ASdeL Aug 11 '15 at 16:49@but see Heiko's answer which is the same as mine (which I have now deleted) but just packaged for actual use. – David Carlisle Aug 11 '15 at 16:54