A neater way within ksh is to slice the variable and it doesn't spawn a new process. If you know that "te" is to be removed from the begginning and "Id" from the end then it's simply like Scrutinizer wrote:-
@rbatte1: This form of parameter expansion should work with any POSIX compliant shell, not just ksh.
Since with ?? the number of positions is still fixed there is no difference between lazy and greedy matching so a single # and a single % would work too..