I would like to get the following code running, but the second test fails with
! Argument of \@secondoftwo has an extra }.
What do I miss?
\documentclass{article}
\usepackage{xstring,ifthen}
\newcommand{\mytest}[1]{%
\newcommand{\s}{\StrChar{#1}{3}}
\newcommand{\x}{c}
3rd charactor of input is: \s ~equal to \x \\
1st test: \IfStrEq{\x}{c}{true}{false} \\
2nd test: \IfStrEq{\s}{c}{true}{false}
}
\begin{document}
\mytest{abcd}
\end{document}
Any help appreciated, thanks, Malte