Get Animator parameter index by name

Is there a way to get an Animator parameter index by name, like you can do with layers?

Never mind, I found a workaround. Here it is, if someone else happens to have this problem:

public byte GetAnimatorParameterIndex(string paramName)
{
    for(byte i = 0; i < anim.parameters.Length; i++)
    {
        if(anim.parameters*.name == paramName)*

{
return i;
}
}
Debug.LogError(“Parameter " + paramName + " doesn’t exist in the animator parameter list!”);
return 0;
}