I am trying to convert a predefined string in a variable to its lowercase and replace the spaces to underscore. But it's not working. The new string after conversion is
like this:
gameΩ_ofΩ_Ω_rollingΩ_Ω_Ω_dice
Desired output is:
game_of_rolling_dice
Can any one help me out please?
\documentclass{article}
\usepackage{xstring}
\usepackage{textcase}
\newcommand{\questionsection}{Game of rolling dice}
\newcommand{\questionsectionfiltered}{\StrSubstitute{\questionsection}{ }{\textunderscore}[\SUBtemp]\MakeLowercase{\SUBtemp}}
\begin{document}
\questionsectionfiltered
\end{document}
Best Answer
Perfect candidate for a token cycle. EDITED to add lowercasing, as requested.