How to remove all non-alphanumeric characters from a string of characters

echo "1a2@b3$c" | tr -dc '[:alnum:]'