I'm writing a math paper, and I've got macros which take labels of theorems, corollaries, etc. as arguments. I'm wondering, is there a way to check if the label starts with a particular prefix?
That is, a command \reftitle which does "Theorem" for \reftitle{thm:122}, "Corollary" for \reftitle{cor:124}, "Statement" for \reftitle{stmt:122}.
The idea is the macro needs to check if the argument starts with cor, thm, etc.
I'm very new to macros in LaTeX, but I haven't been able to find how to do this. Anybody have ideas?

