This seems obvious but I can't seem to find what I need via a search (I can't figure out a good search term I guess).
So what I'm looking for is to have a command that takes in a string, and then calls a command whose name contains that string. For reference the command will be in a sty file.
MWE:
Sty file:
\newcommand{\foo@tempinput}
{This works I hope!}
\newcommand{\DesiredMacro}[1]
{\csname \foo@#1\endcsname}
Actual Document:
\documentclass{article}
\usepackage{Customstyfile}
\begin{document}
\DesiredMacro{tempinput}
\end{document}
And ideally that would output "This works I hope!"
I know the above doesn't work because the \csname isn't expanding the #1, but I'm unsure as to if \csname can be used as a way of executing a command, or if it's only used to define a command?
I want to do this so that I can have a host of commands, and the user can execute the one they need by typing in a name, which protecting the command itself from the user (and avoiding having the user need to know the more complicated command names. I want to be able to have the user input only be a part of the command name).
Thanks!