I use the following expl3 code to upper-case the first character of a programmatic string. The code is from the body of a control sequence definition and is not supposed to be fully expandable.
\tl_set:Nn
\l_tmpa_tl
{ \str_uppercase:n { #1 } }
\tl_set:Nx
\l_tmpb_tl
{
\tl_head:f { \l_tmpa_tl }
\tl_tail:n { #1 }
}
However, I need my code to work with TeX Live 2019 and the \str_uppercase:n control sequence is unavailable in TeX Live 2019. Since I know that #1 will only contain ASCII letters, I assumed that I would be able to substitute \str_uppercase:n with \uppercase. However, \uppercase seems to defy expansion, so \tl_head:f { \l_tmpa_tl } will produce the \uppercase token rather than the first uppercase character.
expl3-generic.tex, not LaTeX. Therefore, LaTeX packages are unavailable. – Witiko Mar 05 '22 at 16:09