I'd like to manipulate strings.
The following hello_en.txt
should become hello
.
This is related to, and quite possibly a duplicate of, Command doing the same job as StrBefore but being expandable. The problem there did not really solve mine, however.
Example
I tried putting an \expandafter
before the first \StrBefore
, but it did not work.
\documentclass{article}
\usepackage{fontspec}
\usepackage{xstring}
\newcommand\mystring{hello\_en.txt}
\begin{document}
\StrBefore{\StrBefore{\mystring{}}{.}}{\_} % more complex DOES NOT WORK
\StrBefore{\StrBefore{hello\_en.txt}{.}}{\_} % simpler DOES NOT WORK
\end{document}