[Tex/LaTex] Capitalize first letter of a defined variable

capitalization

I'm trying to capitalize the first, and only the first letter of line which I have defined as \mytext. I've used {\MakeUppercase put text here?}… until now. But now I have it as a variable

\documentclass{article}

\begin{document}
  \def \mytext {hi how are you?}       

{\MakeUppercase hi how are you?} \par        % => Hi how are you?
{\MakeUppercase \mytext}                     % => HI HOW ARE YOU?
\end{document}

How can I make the first letter of the defined variable capitalized?
Thanks in advance!

Best Answer

  \expandafter\MakeUppercase \mytext
Related Question