I'm working with the stringstrings package. It has a command called \gobblechar which removes the first character in a string or token. Kindly see my MWE below.
\documentclass{article}
\usepackage{stringstrings}
\begin{document}
\def\myAnyString{\gobblechar{v}{Any String}}
\myAnyString
\end{document}
I'm expecting that the first character of "Any String" will be removed. Thus, I'm expecting the output of \myAnyString will be ny String.
However, the output is still Any String.
In the documentation, it says that the result of \gobblechar is \def'ed, instead of \edef'ed. I'm not sure at the moment about the relevance of this, but I know it is very important.
Im thinking no macro expansion has happened in my MWE. But since i have given/executed the command \myAnyString, then it must have expanded already. However, it seems it has not.
There are other packages that can do the job, like \StrGobbleLeft of the xstring package, but if the argument contains commands (for example, if Any String becomes \textbf{Any String}), \StrGobbleLeft fails. But \gobblechar{v}{\textbf{Any String}} will still work, but its output is still Any String only in bold, but the first character is still not removed.
Kindly seeking your help.
\gobblecharmacro uses a single argument ! Try\gooblechar{Any String}... – Paul Gaborit Jun 18 '21 at 08:02